[libGD] #177 [Task opened] gdImageFill stack overflow comparison is invalid
[email protected] Thu, 16 Oct 2008 21:17:45 +0200 (CEST)
| Newsgroups | php.gd.bugs |
|---|---|
| Message-ID | <[email protected]> |
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY. A new Flyspray task has been opened. Details are below. User who did this - Chase Douglas (corp186) Attached to Project - libGD Summary - gdImageFill stack overflow comparison is invalid Task Type - Bug Report Category - Drawing function Status - Unconfirmed Assigned To - Operating System - All Severity - Low Priority - Normal Reported Version - 2.0.35 Due in Version - Undecided Due Date - Undecided Details - In gdImageFill, a stack is created for the flood fill algorithm. Originally it seems the stack was created with space for 1,200,000 structures, but that has since been commented out and the stack is now created dynamically with the depth determined by the size of the image. The macro used to push structures onto the stack was checking for overflow based on checking the current stack pointer. Instead of comparing the stack pointer to the real size of the stack, the stack pointer was compared against the size of the structure (16 bytes) * 1,200,000 * 10. I have no idea why the factor of 10 was there. This large value wraps 32-bit arithmetic all the way around such that the comparison was no longer valid, and it always seemed the stack had overflowed even before anything was pushed onto it. My patch changes the overflow comparison from the incorrect large size to the correct dynamically allocated size of stack. More information can be found at the following URL: http://bugs.libgd.org/?do=details&task_id=177 You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.