Bug 692646 - Bad sizeof() usage in psi/zfapi.c
Summary: Bad sizeof() usage in psi/zfapi.c
Status: RESOLVED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: General (show other bugs)
Version: master
Hardware: PC Linux
: P4 normal
Assignee: Alex Cherepanov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-02 13:35 UTC by Tim Waugh
Modified: 2011-11-04 10:13 UTC (History)
1 user (show)

See Also:
Customer:
Word Size: ---


Attachments
Proposed patch (916 bytes, patch)
2011-11-02 13:35 UTC, Tim Waugh
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Waugh 2011-11-02 13:35:03 UTC
Created attachment 8057 [details]
Proposed patch

sizeof() needs the object, not its address.  Found using Coverity.
Comment 1 Chris Liddell (chrisl) 2011-11-04 10:13:58 UTC
Fixed in:

http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=2a3a32

I opted to replace the memcmp() in question with an explicit check for element equality. The reason I've opted for this is because, for example, [1 -0 0 1 0 0] == [1 0 0 1 0 0] which an explicit equality check will evaluate correctly, but a memcmp() will fail the check.

Thanks for pointing out the problem!