From d339b8398c3871f8c923979a4f5ae1c534d61a07 Mon Sep 17 00:00:00 2001 From: Alex Smith Date: Sat, 18 Aug 2012 13:52:10 +0100 Subject: [PATCH] CID 712424: Unintended sign extension. Fix taken from glibc, glibc bug #3747. --- src/system/libroot/posix/glibc/stdlib/jrand48_r.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/system/libroot/posix/glibc/stdlib/jrand48_r.c b/src/system/libroot/posix/glibc/stdlib/jrand48_r.c index 2383ae129e..39e8d090a6 100644 --- a/src/system/libroot/posix/glibc/stdlib/jrand48_r.c +++ b/src/system/libroot/posix/glibc/stdlib/jrand48_r.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995, 1997, 1998, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1995, 1997, 1998, 2001, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , August 1995. @@ -30,7 +30,7 @@ __jrand48_r (xsubi, buffer, result) return -1; /* Store the result. */ - *result = ((xsubi[2] << 16) | xsubi[1]) & 0xffffffffl; + *result = (int32_t) ((xsubi[2] << 16) | xsubi[1]); return 0; }