From: Roy Marples Date: Wed, 16 Oct 2019 13:48:01 +0000 (+0100) Subject: compat: Fix UB in arc4random. X-Git-Tag: v8.1.1~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0209dbe976b27ba88840406685bbf1ceca2c5e8f;p=thirdparty%2Fdhcpcd.git compat: Fix UB in arc4random. --- diff --git a/compat/arc4random.c b/compat/arc4random.c index ab06df04..045e0234 100644 --- a/compat/arc4random.c +++ b/compat/arc4random.c @@ -90,7 +90,7 @@ arc4_getword(struct arc4_stream *as) { int val; - val = arc4_getbyte(as) << 24; + val = (int)((unsigned int)arc4_getbyte(as) << 24); val |= arc4_getbyte(as) << 16; val |= arc4_getbyte(as) << 8; val |= arc4_getbyte(as);