Commit 7cde54a
fix(cli): fix secure_getenv() bypass of one-shot token protection
secure_getenv() was calling get_token_index() before init_token_list()
and without the mutex, causing all token protection to be bypassed when
secure_getenv() was the first call into the library (empty token list
returns -1 for all lookups). Added initialization, mutex acquisition,
and recursion guard matching the getenv() implementation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent ad7a4bc commit 7cde54a
1 file changed
+18
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
407 | 420 | | |
408 | 421 | | |
409 | | - | |
| 422 | + | |
410 | 423 | | |
| 424 | + | |
| 425 | + | |
411 | 426 | | |
412 | 427 | | |
413 | 428 | | |
414 | | - | |
415 | | - | |
| 429 | + | |
416 | 430 | | |
417 | 431 | | |
418 | 432 | | |
| |||
445 | 459 | | |
446 | 460 | | |
447 | 461 | | |
| 462 | + | |
448 | 463 | | |
449 | 464 | | |
450 | 465 | | |
0 commit comments