Files
nuttx/libs/libc/misc
Nathan Hartman bf91047f33 libc: Fix getrandom() bug: Didn't propagate read error
* libs/libc/misc/lib_getrandom.c, in function getrandom():
  We were assigning the return value of _NX_READ() to nbytes, a
  variable of the unsigned type size_t. Note that _NX_READ() resolves
  to either read() or nx_read(), both of which return the signed type
  ssize_t to indicate either the number of bytes read successfully
  (>= 0) or an error (< 0). Then we were testing for a negative
  size_t value, a condition that can never occur. The end result is
  that if an error occured in _NX_READ(), it would never be detected
  and getrandom() would return some large positive value. This bug is
  corrected by assigning the return value of _NX_READ() to a new local
  variable, ret, of size ssize_t.
2022-07-01 11:51:53 +08:00
..
2021-12-07 04:01:27 -08:00
2021-08-02 08:23:35 -03:00
2022-06-09 18:19:48 +03:00
2021-04-03 04:20:31 -07:00
2021-11-28 23:31:16 +01:00
2022-06-09 18:19:48 +03:00