From: Xi Wang Date: Thu, 16 Feb 2012 16:55:48 +0000 (-0500) Subject: libceph: fix overflow check in crush_decode() X-Git-Tag: v3.4-rc1~76^2~60 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=64486697771cbe219fffcb5c8e2ed9ca4fdf086c;p=pandora-kernel.git libceph: fix overflow check in crush_decode() The existing overflow check (n > ULONG_MAX / b) didn't work, because n = ULONG_MAX / b would both bypass the check and still overflow the allocation size a + n * b. The correct check should be (n > (ULONG_MAX - a) / b). Signed-off-by: Xi Wang Signed-off-by: Sage Weil --- Reading git-diff-tree failed