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

Marshall Clow mclow.lists at gmail.com
Tue May 27 07:45:25 PDT 2014


On May 20, 2014, at 2:25 AM, David Majnemer <david.majnemer at gmail.com> wrote:

> 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.

I like this; but can you think of any way to test it?

— Marshall


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140527/40496d29/attachment.html>


More information about the cfe-commits mailing list