Bug 692646

Summary: Bad sizeof() usage in psi/zfapi.c
Product: Ghostscript Reporter: Tim Waugh <twaugh>
Component: GeneralAssignee: Alex Cherepanov <alex>
Status: RESOLVED FIXED    
Severity: normal CC: chris.liddell
Priority: P4    
Version: master   
Hardware: PC   
OS: Linux   
Customer: Word Size: ---
Attachments: Proposed patch

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!