mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-06 18:00:28 +00:00
Store StrlenDevFd in n
This commit is contained in:
parent
e93c8c4f8f
commit
db1fcc1dca
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