diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2016-02-29 09:48:12 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2017-01-09 07:32:08 +0100 |
commit | 03d1e6089230bad79b78ce6e8ea2b872cbaf37e2 (patch) | |
tree | 91d06d8497da9e722a63617f7c087f66918d94cd | |
parent | 415f72da087aa13404517ae81f5bb58883b9786e (diff) | |
download | gnutls-03d1e6089230bad79b78ce6e8ea2b872cbaf37e2.tar.gz |
opencdk: Fixes to prevent undefined behavior (found with libubsan)
-rw-r--r-- | lib/opencdk/misc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/opencdk/misc.c b/lib/opencdk/misc.c index 0d4ee89121..35172e5dd4 100644 --- a/lib/opencdk/misc.c +++ b/lib/opencdk/misc.c @@ -41,7 +41,7 @@ u32 _cdk_buftou32(const byte * buf) if (!buf) return 0; - u = buf[0] << 24; + u = ((u32)buf[0]) << 24; u |= buf[1] << 16; u |= buf[2] << 8; u |= buf[3]; |