|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2015-01-02 07:37 UTC] bugreports at internot dot info
Description:
------------
Hi,
In /ext/gd/libgd/gd.c:
3072 for (yy = y; yy >= yy - 1; y--) {
3073 gdFree(src->tpixels[y]);
3074 }
If this is ever run, it will be stuck in a loop, which will eventually cause invalid frees (and/or) double frees.
I'm guessing it's supposed to be like this code:
3053 for (yy = y - 1; yy >= yy - 1; yy--) {
3054 gdFree(src->pixels[yy]);
3055 }
"for (yy = y - 1;"
Thanks,
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 14:00:01 2025 UTC |
Hi, Why do you think this is not a sec. issue? I think(but am not 100% sure) that it will cause the loop to go down the 0, then it'll go to -1(aka. max int), and will try to free invalid places. e.g: unsigned int y = 5; unsigned int yy; for (yy = y; yy >= yy - 1; y--) { printf("%u\n", y); } outputs: $ ./a.out | head -n10 5 4 3 2 1 0 4294967295 4294967294 4294967293 1. it will go on forever, and 2. it will try to free invalid memory. Thanks,