musl/src/misc/getentropy.c, branch master musl - an implementation of the standard library for Linux-based systems getentropy: fix UB if len==0 2020年07月24日T18:54:40+00:00 Bartosz Brachaczek b.brachaczek@gmail.com 2020年07月16日T23:16:28+00:00 ddf1750e42e17f75e765d494874308c6393118bb if len==0, an uninitalized variable would be returned
if len==0, an uninitalized variable would be returned
fix issues from public functions defined without declaration visible 2018年09月12日T18:34:20+00:00 Rich Felker dalias@aerifal.cx 2018年09月06日T15:15:15+00:00 c221d3e5862e249b03aa7569d5fec6389294fb22 policy is that all public functions which have a public declaration should be defined in a context where that public declaration is visible, to avoid preventable type mismatches. an audit performed using GCC's -Wmissing-declarations turned up the violations corrected here. in some cases the public header had not been included; in others, a feature test macro needed to make the declaration visible had been omitted. in the case of gethostent and getnetent, the omission seems to have been intentional, as a hack to admit a single stub definition for both functions. this kind of hack is no longer acceptable; it's UB and would not fly with LTO or advanced toolchains. the hack is undone to make exposure of the declarations possible.
policy is that all public functions which have a public declaration
should be defined in a context where that public declaration is
visible, to avoid preventable type mismatches.
an audit performed using GCC's -Wmissing-declarations turned up the
violations corrected here. in some cases the public header had not
been included; in others, a feature test macro needed to make the
declaration visible had been omitted.
in the case of gethostent and getnetent, the omission seems to have
been intentional, as a hack to admit a single stub definition for both
functions. this kind of hack is no longer acceptable; it's UB and
would not fly with LTO or advanced toolchains. the hack is undone to
make exposure of the declarations possible.
add getentropy function 2018年02月23日T07:57:52+00:00 Rich Felker dalias@aerifal.cx 2018年02月23日T07:54:01+00:00 82f176803ae07e34229906d5c7c62889e665dc97 based loosely on patch by Hauke Mehrtens; converted to wrap the public API of the underlying getrandom function rather than direct syscalls, so that if/when a fallback implementation of getrandom is added it will automatically get picked up by getentropy too.
based loosely on patch by Hauke Mehrtens; converted to wrap the public
API of the underlying getrandom function rather than direct syscalls,
so that if/when a fallback implementation of getrandom is added it
will automatically get picked up by getentropy too.

AltStyle によって変換されたページ (->オリジナル) /