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 512374 - array accessed past end
array accessed past end
Status: RESOLVED FIXED
Product: gthumb
Classification: Other
Component: general
2.10.x
Other All
: Normal normal
: ---
Assigned To: Paolo Bacchilega
Paolo Bacchilega
Depends on:
Blocks:
 
 
Reported: 2008-01-27 14:45 UTC by Marcus Meissner
Modified: 2008-04-24 13:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Adds an entry for GTH_SORT_METHOD_MANUAL to sort_method_to_idx. (1.65 KB, patch)
2008-04-21 03:29 UTC, John Bryant
committed Details | Review

Description Marcus Meissner 2008-01-27 14:45:05 UTC
Please describe the problem:
gcc 4.3 outputs this warning:

dlg-web-exporter.c:498: warning: array subscript is above array bounds
which reads:
        if (!reorderable && (sort_method_to_idx[GTH_SORT_METHOD_MANUAL] == idx))


and yes, GTH_SORT_METHOD_MANUAL is 7 (8th element of the enum GthSortMethod), while the sort_method_to_idx has just 6 entries.

Steps to reproduce:
1. review code, or
2. compile with gcc4.3
3. 


Actual results:


Expected results:


Does this happen every time?
yes

Other information:
Comment 1 Michael Chudobiak 2008-01-28 14:15:47 UTC
This should be simple to fix. Marking as gnome-love.
Comment 2 John Bryant 2008-04-21 03:29:09 UTC
Created attachment 109606 [details] [review]
Adds an entry for GTH_SORT_METHOD_MANUAL to sort_method_to_idx.

This problem also occurs in dlg-rename-series.c and dlg-png-exporter.c, so I patched it there as well.