Commit c82f77a
ecryptfs: Replace strcpy with strscpy in ecryptfs_cipher_code_to_string
strcpy() has been deprecated [1] because it performs no bounds checking
on the destination buffer, which can lead to buffer overflows. Since
the parameter 'char *str' is just a pointer with no size information,
extend the function with a 'size' parameter to pass the destination
buffer's size as an additional argument. Adjust the call sites
accordingly.
Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strcpy [1]
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Tyler Hicks <code@tyhicks.com>1 parent 3bdc6ca commit c82f77a
3 files changed
Lines changed: 12 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
862 | 862 | | |
863 | 863 | | |
864 | 864 | | |
| 865 | + | |
865 | 866 | | |
866 | 867 | | |
867 | 868 | | |
868 | 869 | | |
869 | | - | |
| 870 | + | |
870 | 871 | | |
871 | 872 | | |
872 | 873 | | |
873 | 874 | | |
874 | 875 | | |
875 | 876 | | |
876 | 877 | | |
877 | | - | |
| 878 | + | |
| 879 | + | |
878 | 880 | | |
879 | 881 | | |
880 | 882 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
571 | 571 | | |
572 | 572 | | |
573 | 573 | | |
574 | | - | |
| 574 | + | |
575 | 575 | | |
576 | 576 | | |
577 | 577 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
911 | 911 | | |
912 | 912 | | |
913 | 913 | | |
914 | | - | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
915 | 917 | | |
916 | 918 | | |
917 | 919 | | |
| |||
1129 | 1131 | | |
1130 | 1132 | | |
1131 | 1133 | | |
1132 | | - | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
1133 | 1137 | | |
1134 | 1138 | | |
1135 | 1139 | | |
| |||
1395 | 1399 | | |
1396 | 1400 | | |
1397 | 1401 | | |
| 1402 | + | |
1398 | 1403 | | |
1399 | 1404 | | |
1400 | 1405 | | |
| |||
0 commit comments