diff options
author | Justus Winter <justus@g10code.com> | 2016-03-07 14:25:38 +0100 |
---|---|---|
committer | Justus Winter <justus@g10code.com> | 2016-03-07 14:38:11 +0100 |
commit | a68ca5a90457ac97eee4efd7fdea596d27c54697 (patch) | |
tree | b74b76c48d449801b8b38fce48c093d7b08929ab /kbx | |
parent | scd: Bug fix for a device with multiple interfaces. (diff) | |
download | gnupg2-a68ca5a90457ac97eee4efd7fdea596d27c54697.tar.xz gnupg2-a68ca5a90457ac97eee4efd7fdea596d27c54697.zip |
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>
Diffstat (limited to 'kbx')
-rw-r--r-- | kbx/keybox-file.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kbx/keybox-file.c b/kbx/keybox-file.c index eaf756546..59dfe0c3e 100644 --- a/kbx/keybox-file.c +++ b/kbx/keybox-file.c @@ -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); |