From: Jeff King Date: Fri, 19 Feb 2016 11:21:30 +0000 (-0500) Subject: tree-diff: catch integer overflow in combine_diff_path allocation X-Git-Tag: v2.4.11~1^2~5 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/d770187872e8408a8e4c0533cf6e6913776882b0?ds=inline;hp=d770187872e8408a8e4c0533cf6e6913776882b0 tree-diff: catch integer overflow in combine_diff_path allocation A combine_diff_path struct has two "flex" members allocated alongside the struct: a string to hold the pathname, and an array of parent pointers. We use an "int" to compute this, meaning we may easily overflow it if the pathname is extremely long. We can fix this by using size_t, and checking for overflow with the st_add helper. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano ---