[PATCH] [libc++] Don't return uninitialized data from random_device::operator()

David Majnemer david.majnemer at gmail.com
Tue May 20 02:25:00 PDT 2014


Oops, sent out the wrong version of this patch.  Attached is what I
intended to send.


On Tue, May 20, 2014 at 12:28 AM, David Majnemer
<david.majnemer at gmail.com>wrote:

> random_device::operator() as currently implemented does not correctly
> handle errors returned by read.  This can result in it returning
> uninitialized data.
>
> To fix this, wrap the call to read in a loop.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140520/e10cb5a6/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t.patch
Type: application/octet-stream
Size: 748 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140520/e10cb5a6/attachment.obj>


More information about the cfe-commits mailing list