After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 353613 - Negative array access in get_extension
Negative array access in get_extension
Status: RESOLVED FIXED
Product: gthumb
Classification: Other
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Paolo Bacchilega
Paolo Bacchilega
Depends on:
Blocks:
 
 
Reported: 2006-08-30 23:08 UTC by Pascal Terjan
Modified: 2006-08-31 18:57 UTC
See Also:
GNOME target: ---
GNOME version: 2.15/2.16


Attachments
Patch changing the order of tests (470 bytes, patch)
2006-08-30 23:10 UTC, Pascal Terjan
none Details | Review

Description Pascal Terjan 2006-08-30 23:08:49 UTC
In get_extension (libgthumb/file-utils.c) line 593 is :

((ptr[p] != '.') && (p >= 0))

a better condition would be

((p >= 0) && (ptr[p] != '.'))

Currently we access ptr[-1] in the test when there is no dot in the path.

(Found with valgrind)
Comment 1 Pascal Terjan 2006-08-30 23:10:55 UTC
Created attachment 71938 [details] [review]
Patch changing the order of tests
Comment 2 Paolo Bacchilega 2006-08-31 18:57:32 UTC
patch applied, thanks.