Opened 6 years ago

Closed 6 years ago

#9487 closed bug (fixed)

GIFLoad array subscript below array bounds

Reported by: pdziepak Owned by: pdziepak
Priority: normal Milestone: R1
Component: Add-Ons/Translators/GIF Version:
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: yes Platform: All

Description

Due to variable range propagation enabled GCC notices (incorrectly) that

newEntry[fOldCodeLength] = *fOldCode;

may be unsafe due to fOldCodeLength being a signed integer. When building under Haiku it results in a warning which is treated as an error.

Attachments (1)

0001-Fix-9487-GIFLoad-array-subscript-below-array-bounds.patch (2.5 KB) - added by pdziepak 6 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 6 years ago by pdziepak

Has a Patch: set

comment:2 Changed 6 years ago by pdziepak

To be honest I was a bit concerned about these copying loops but since I know nothing about GIF format and memcpy() is not an exact equivalent of them I decided to leave it as it is. It is out of scope of this patch anyway.

comment:3 Changed 6 years ago by jscipione

Note that the warning causes Haiku not to build from within Haiku.

comment:4 Changed 6 years ago by leavengood

Now that you have commit access I say +1 in committing this Pawel.

comment:5 Changed 6 years ago by pdziepak

Owner: changed from nobody to pdziepak
Status: newin-progress

comment:6 Changed 6 years ago by pdziepak

Resolution: fixed
Status: in-progressclosed

Fixed in hrev45358.

Note: See TracTickets for help on using tickets.