Commit b31d3f7
apparmor: Replace sprintf/strcpy with scnprintf/strscpy in aa_policy_init
strcpy() is deprecated and sprintf() does not perform bounds checking
either. Although an overflow is unlikely, it's better to proactively
avoid it by using the safer strscpy() and scnprintf(), respectively.
Additionally, unify memory allocation for 'hname' to simplify and
improve aa_policy_init().
Closes: KSPP/linux#88
Reviewed-by: Serge Hallyn <[email protected]>
Signed-off-by: Thorsten Blum <[email protected]>
Signed-off-by: John Johansen <[email protected]>1 parent 7db8c3c commit b31d3f7
1 file changed
Lines changed: 7 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
478 | 478 | | |
479 | 479 | | |
480 | 480 | | |
| 481 | + | |
481 | 482 | | |
| 483 | + | |
482 | 484 | | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
491 | | - | |
| 485 | + | |
492 | 486 | | |
493 | 487 | | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
494 | 492 | | |
495 | 493 | | |
496 | 494 | | |
| |||
0 commit comments