Commit 27e9faf
committed
gcc-plugins/stackleak: Exactly match strings instead of prefixes
Since STRING_CST may not be NUL terminated, strncmp() was used for check
for equality. However, this may lead to mismatches for longer section
names where the start matches the tested-for string. Test for exact
equality by checking for the presences of NUL termination.
Cc: Alexander Popov <alex.popov@linux.com>
Signed-off-by: Kees Cook <keescook@chromium.org>1 parent f154066 commit 27e9faf
1 file changed
Lines changed: 21 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
429 | 429 | | |
430 | 430 | | |
431 | 431 | | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
432 | 449 | | |
433 | 450 | | |
434 | 451 | | |
| |||
438 | 455 | | |
439 | 456 | | |
440 | 457 | | |
441 | | - | |
| 458 | + | |
442 | 459 | | |
443 | | - | |
| 460 | + | |
444 | 461 | | |
445 | | - | |
| 462 | + | |
446 | 463 | | |
447 | | - | |
| 464 | + | |
448 | 465 | | |
449 | 466 | | |
450 | 467 | | |
| |||
0 commit comments