From 0209dbe976b27ba88840406685bbf1ceca2c5e8f Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Wed, 16 Oct 2019 14:48:01 +0100 Subject: [PATCH] compat: Fix UB in arc4random. --- compat/arc4random.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.47.2