GNOME Bugzilla – Bug 512374
array accessed past end
Last modified: 2008-04-24 13:22:28 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:
This should be simple to fix. Marking as gnome-love.
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.
Patch committed, thanks! http://svn.gnome.org/viewvc/gthumb?view=revision&revision=2321 http://svn.gnome.org/viewvc/gthumb?view=revision&revision=2322 - Mike