mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02: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
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue