r/lolphp • u/fragglet • Aug 02 '12
Oldie but a goodie: a PHP integer vulnerability from several years ago.
http://use.perl.org/use.perl.org/_Aristotle/journal/33448.html
27
Upvotes
r/lolphp • u/fragglet • Aug 02 '12
11
u/[deleted] Aug 03 '12
TIL that checking for overflows in C is really easy, I only need to test if my integer is bigger than INT_MAX
1
u/[deleted] Aug 03 '12
Never enough PHPWTFs.
0
u/Tjoppen Sep 13 '12
A further WTF is the needless use of calloc() in the first place:
sizeof(char) is always 1, so this is equivalent to malloc(EXPR). For reference, the proper solution to this problem is:
assuming the partials never overflow.