mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-03 17:58:30 +00:00
Store StrlenDevFd in n (#1056)
This commit is contained in:
parent
e93c8c4f8f
commit
3315b6ef11
1 changed files with 4 additions and 4 deletions
|
@ -180,10 +180,10 @@ static inline void InitProgramExecutableNameImpl(void) {
|
||||||
empty string to obviate the TOCTOU problem between loader and binary.
|
empty string to obviate the TOCTOU problem between loader and binary.
|
||||||
*/
|
*/
|
||||||
if (!(b = DevFd()) ||
|
if (!(b = DevFd()) ||
|
||||||
0 != strncmp(b, __program_executable_name, StrlenDevFd()) ||
|
0 != strncmp(b, __program_executable_name, (n = StrlenDevFd())) ||
|
||||||
!__program_executable_name[StrlenDevFd()] ||
|
!__program_executable_name[n] ||
|
||||||
__program_executable_name[StrlenDevFd()] == '.' ||
|
__program_executable_name[n] == '.' ||
|
||||||
strchr(__program_executable_name + StrlenDevFd(), '/')) {
|
strchr(__program_executable_name + n, '/')) {
|
||||||
goto UseEmpty;
|
goto UseEmpty;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue