diff options
author | Werner Koch <wk@gnupg.org> | 2014-11-05 08:23:15 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2014-11-05 08:23:15 +0100 |
commit | 91b826a38880fd8a989318585eb502582636ddd8 (patch) | |
tree | cbac936eb1bd009986f4f95d762316a4a36c19b9 /g10/build-packet.c | |
parent | Remove all expired common CA certificates. (diff) | |
download | gnupg2-91b826a38880fd8a989318585eb502582636ddd8.tar.xz gnupg2-91b826a38880fd8a989318585eb502582636ddd8.zip |
Avoid sign extension when shifting the MSB.
* sm/fingerprint.c (gpgsm_get_short_fingerprint): Cast MSB before
shifting.
* g10/build-packet.c (delete_sig_subpkt): Ditto.
Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'g10/build-packet.c')
-rw-r--r-- | g10/build-packet.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/g10/build-packet.c b/g10/build-packet.c index c04abab54..6bd1c9b0d 100644 --- a/g10/build-packet.c +++ b/g10/build-packet.c @@ -618,8 +618,10 @@ delete_sig_subpkt (subpktarea_t *area, sigsubpkttype_t reqtype ) if( n == 255 ) { if( buflen < 4 ) break; - n = (buffer[0] << 24) | (buffer[1] << 16) - | (buffer[2] << 8) | buffer[3]; + n = (((size_t)buffer[0] << 24) + | (buffer[1] << 16) + | (buffer[2] << 8) + | buffer[3]); buffer += 4; buflen -= 4; } |