Bug 2100

Summary: Missing dereference when bzeroing unused identities
Product: Portable OpenSSH Reporter: Colin Watson <cjwatson>
Component: sshAssignee: Assigned to nobody <unassigned-bugs>
Status: CLOSED FIXED    
Severity: enhancement CC: djm
Priority: P5    
Version: 6.2p1   
Hardware: Other   
OS: Linux   
Bug Depends on:    
Bug Blocks: 2076    
Attachments:
Description Flags
Fix size passed to bzero none

Description Colin Watson 2013-05-09 18:45:19 AEST
Created attachment 2256 [details]
Fix size passed to bzero

GCC 4.8 warns (for Debian package, so line numbers may be off from mainline, sorry):

../sshconnect2.c: In function 'pubkey_prepare':
../sshconnect2.c:1527:20: warning: argument to 'sizeof' in 'bzero' call is the same expression as the destination; did you mean to dereference it? [-Wsizeof-pointer-memaccess]
    bzero(id, sizeof(id));

It's correct; this code only zeroes the first sizeof(pointer) bytes of the Identity structure, rather than the whole thing.  Patch attached.
Comment 1 Damien Miller 2013-05-10 13:40:21 AEST
applied - will be in 6.3. Thanks
Comment 2 Damien Miller 2016-08-02 10:41:02 AEST
Close all resolved bugs after 7.3p1 release