Skip to content

Commit 6f23f24

Browse files
committed
Coverity: Untrusted divisor
1. Add typecast to assignment in ato32(). Fixes CID: 572837
1 parent c20cafb commit 6f23f24

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/misc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ STATIC INLINE word32 min(word32 a, word32 b)
7474
/* convert opaque to 32 bit integer */
7575
STATIC INLINE void ato32(const byte* c, word32* u32)
7676
{
77-
*u32 = (c[0] << 24) | (c[1] << 16) | (c[2] << 8) | c[3];
77+
*u32 = ((word32)(c[0] << 24) | (c[1] << 16) | (c[2] << 8) | c[3]);
7878
}
7979

8080

0 commit comments

Comments
 (0)