[Webkit-unassigned] [Bug 146473] Errors in read() are not handled in WTF::cryptographicallyRandomValuesFromOS.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jun 30 15:06:17 PDT 2015


https://bugs.webkit.org/show_bug.cgi?id=146473

--- Comment #5 from Michael Saboff <msaboff at apple.com> ---
Comment on attachment 255860
  --> https://bugs.webkit.org/attachment.cgi?id=255860
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=255860&action=review

> Source/WTF/wtf/OSRandomSource.cpp:63
> +    int fd;
> +    // We need to check for both EAGAIN and EINTR since on some systems /dev/urandom
> +    // is blocking and on others it is non-blocking.
> +    do {
> +        fd = open("/dev/urandom", O_RDONLY, 0);
> +    } while (fd < 0 && (errno == EAGAIN || errno == EINTR));

I don't think there is a need to check for the EAGAIN and EINTR cases for open().  EAGAIN is documented to only happen for slave ptys and EINTR due to a signal.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150630/8d1469a4/attachment.html>


More information about the webkit-unassigned mailing list