Commit 1c90ed1
apparmor: Replace deprecated strcpy with memcpy in gen_symlink_name
strcpy() is deprecated; use memcpy() instead. Unlike strcpy(), memcpy()
does not copy the NUL terminator from the source string, which would be
overwritten anyway on every iteration when using strcpy(). snprintf()
then ensures that 'char *s' is NUL-terminated.
Replace the hard-coded path length to remove the magic number 6, and add
a comment explaining the extra 11 bytes.
Closes: KSPP/linux#88
Signed-off-by: Thorsten Blum <[email protected]>
Signed-off-by: John Johansen <[email protected]>1 parent 00b6765 commit 1c90ed1
1 file changed
Lines changed: 8 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1607 | 1607 | | |
1608 | 1608 | | |
1609 | 1609 | | |
1610 | | - | |
| 1610 | + | |
| 1611 | + | |
| 1612 | + | |
1611 | 1613 | | |
| 1614 | + | |
| 1615 | + | |
1612 | 1616 | | |
1613 | 1617 | | |
1614 | 1618 | | |
1615 | 1619 | | |
1616 | 1620 | | |
1617 | | - | |
1618 | | - | |
1619 | | - | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
1620 | 1624 | | |
1621 | 1625 | | |
1622 | 1626 | | |
| |||
0 commit comments