mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-02 12:01:32 +01:00
kbx: Avoid undefined behavior.
* kbx/keybox-file.c (_keybox_read_blob2): Cast to unsigned int before shifting. Signed-off-by: Justus Winter <justus@g10code.com>
This commit is contained in:
parent
7a32f87ccc
commit
a68ca5a904
@ -77,7 +77,7 @@ _keybox_read_blob2 (KEYBOXBLOB *r_blob, FILE *fp, int *skipped_deleted)
|
||||
return gpg_error_from_syserror ();
|
||||
}
|
||||
|
||||
imagelen = (c1 << 24) | (c2 << 16) | (c3 << 8 ) | c4;
|
||||
imagelen = ((unsigned int) c1 << 24) | (c2 << 16) | (c3 << 8 ) | c4;
|
||||
if (imagelen < 5)
|
||||
return gpg_error (GPG_ERR_TOO_SHORT);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user