From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 114036 invoked by alias); 20 Mar 2018 17:58:15 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 114021 invoked by uid 89); 20 Mar 2018 17:58:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=HX-HELO:sk:zimbra. X-HELO: zimbra.cs.ucla.edu Subject: Re: Fix signed integer overflow in random_r (bug 17343) To: Joseph Myers Cc: libc-alpha@sourceware.org References: From: Paul Eggert Message-ID: Date: Tue, 20 Mar 2018 17:58:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2018-03/txt/msg00490.txt.bz2 On 03/20/2018 10:54 AM, Joseph Myers wrote: > *result = (val >> 1) & 0x7fffffff; One other thing I just noticed: now that val is uint32_t, the above should be simplifed to "*result = val >> 1;". The patch looks good otherwise; thanks.