From owner-svn-src-head@freebsd.org Thu Jul 28 13:02:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B8F1BA5DBB for ; Thu, 28 Jul 2016 13:02:58 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yw0-x22c.google.com (mail-yw0-x22c.google.com [IPv6:2607:f8b0:4002:c05::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1D301128E for ; Thu, 28 Jul 2016 13:02:57 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yw0-x22c.google.com with SMTP id j12so85128686ywb.2 for ; Thu, 28 Jul 2016 06:02:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=DucLEfkw/d2TNgZMEZsK38h0bH6dQ4zgnD2YfItKC5c=; b=cUr3JtP92FIgz4d/oOki1oBi+vz8gf3NG+h/HZsDDwhQi8lKpqWjdtInWBFzA7e5kL OqvHuGr6b189r9huthti/ZOSHWqB5atoO56RxXmFLMwr33ww7IqbBrAFI1OyWZTyngTH QGfLxYgo+e3Pohxdzyt/50KTZbcIPm9cgZ6+6acHDKbfZsvsApqyB2Y9vwPUY5niD/fm hBSa5uqQS3vXKxDj2i2C+U9FxbtWJ1ZtsIbr6wxIp8SNZVe3MQZrIEQR7NqsOnzHNMs7 jCs9R3hdOY7Wovb0ZPXsgj2UNK6THn1YwLGDy9xSwruoLpsKK2T11r7dNIxBwc8xobl3 kPyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=DucLEfkw/d2TNgZMEZsK38h0bH6dQ4zgnD2YfItKC5c=; b=hYX0xZkHxeTVYdidHlcC9sIlGqYFNvQX6UCQUEqq3+FOdZu8EQuVJsw+HDKzBBQ+nn QGvX6HzOwWDbtld1vTczkE2ygjD+8VeeshMrGenFm1J2Ok59r8ydNzF8+st5VU8O9UMe i2I9P7YFvmuAMD9Gdd4s5823ZzFPlShkIYZ/KDEQjbuowr1n9QXyVO2MDkfKCpspwAnq D3wQLjOOekt8GxlOpSchjLXwVjIJPdCPy8XNLbOvz1j0y/Ezh/cTwoIGCpkn8Fl7iWcT r9p5oHoovX6hflHvusr0YJanR9Ztg7LjhPEmRj0Kb4wLEj7nZIL3DEOoAcUG8pZHmpwZ pUnQ== X-Gm-Message-State: AEkoouuzV3dJHLId7RkPeGzpBHXzYCfAMSQ+uqI396Xk9vChIP68NEcD8DEM6hsYS24E8r5rcw0xRdd96RGD7g== X-Received: by 10.13.253.134 with SMTP id n128mr28278352ywf.20.1469710977114; Thu, 28 Jul 2016 06:02:57 -0700 (PDT) MIME-Version: 1.0 Received: by 10.13.201.71 with HTTP; Thu, 28 Jul 2016 06:02:56 -0700 (PDT) In-Reply-To: <20160727091654.P1485@besplex.bde.org> References: <201607262011.u6QKBTDp043256@repo.freebsd.org> <20160727091654.P1485@besplex.bde.org> From: Ed Schouten Date: Thu, 28 Jul 2016 15:02:56 +0200 Message-ID: Subject: Re: svn commit: r303342 - in head: include lib/libc/stdlib To: Bruce Evans Cc: Ed Schouten , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2016 13:02:58 -0000 Hi Bruce, 2016-07-27 2:44 GMT+02:00 Bruce Evans : > This might work here since the type is unsigned, but it wouldn't work to > change from int to long. Yes. That's a pretty good remark. What makes this pretty safe in this case is that srandom() discard the top bits anyway. The first thing it does is cast the argument to an uint32_t, so even if we didn't properly zero/size extend this, it wouldn't end up being used. Best regards, -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717