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 785696 - io-gif: Switch arguments to fread() to fix Coverity issue
io-gif: Switch arguments to fread() to fix Coverity issue
Status: RESOLVED FIXED
Product: gdk-pixbuf
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gdk-pixbuf-maint
gdk-pixbuf-maint
Depends on:
Blocks:
 
 
Reported: 2017-08-01 14:36 UTC by Philip Withnall
Modified: 2017-08-15 09:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
io-gif: Switch arguments to fread() to fix Coverity issue (1.08 KB, patch)
2017-08-01 14:36 UTC, Philip Withnall
committed Details | Review

Description Philip Withnall 2017-08-01 14:36:10 UTC
Trivial patch attached. Hopefully that will fix the Coverity issue (#1452089).
Comment 1 Philip Withnall 2017-08-01 14:36:18 UTC
Created attachment 356740 [details] [review]
io-gif: Switch arguments to fread() to fix Coverity issue

The arguments were provided the wrong way round: the variable number
should always be the nmemb argument, rather than loading a single
element of variable size.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Comment 2 Tobias Mueller 2017-08-13 23:25:26 UTC
Review of attachment 356740 [details] [review]:

FWIW, patch LGTM.
Comment 3 Bastien Nocera 2017-08-14 18:08:22 UTC
Review of attachment 356740 [details] [review]:

Does this make any difference in terms of performance, or do the 2 different options behave exactly the same?

If the latter, then please push to master.
Comment 4 Philip Withnall 2017-08-15 09:15:14 UTC
Performance seems to be the same, according to SO: https://stackoverflow.com/questions/8589425/how-does-fread-really-work#answer-8589797. I haven’t profiled.

Pushed to master with one additional fix to update the error handling for the new potential return values (which are now 0..len rather than 0..1).

Attachment 356740 [details] pushed as 82664fe - io-gif: Switch arguments to fread() to fix Coverity issue