[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:14:56 PDT 2015


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

Michael Saboff <msaboff at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #255864|review?                     |review-
              Flags|                            |

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

View in context: https://bugs.webkit.org/attachment.cgi?id=255864&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));

Remove this loop.  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/48c8ee10/attachment-0001.html>


More information about the webkit-unassigned mailing list