On 6/26/24 19:57, Ma Ke wrote:
The open() function returns -1 on error. openat() and open() initialize
'from' and 'to', and only 'from' validated with 'if' statement. If the
initialization of variable 'to' fails, we should better check the value
of 'to' and close 'from' to avoid possible file lea
>… openat() and open() initialize
> 'from' and 'to', and only 'from' validated with 'if' statement.
Why do you find such information helpful?
> If the
> initialization of variable 'to' fails,
The open() function returns -1 on error. openat() and open() initialize
'from' and 'to', and only 'from' validated with 'if' statement. If the
initialization of variable 'to' fails, we should better check the value
of 'to' and close 'from' to avoid possible file leak. Improve the checking
of 'from'