Commit 02b0767
DRBD: replace strcpy with strscpy
strcpy is deprecated due to lack of bounds checking. This patch replaces
strcpy with strscpy, the recommended alternative for null terminated
strings, to follow best practices.
I had to do a small refactor for __drbd_send_protocol since it uses
strlen anyways. so why not use that for strscpy.
V2:
- I forgot about null termination so i fixed it.
Signed-off-by: Eslam Khafagy <[email protected]>1 parent 87bbbbc commit 02b0767
2 files changed
+11
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
742 | 742 | | |
743 | 743 | | |
744 | 744 | | |
745 | | - | |
| 745 | + | |
746 | 746 | | |
747 | | - | |
| 747 | + | |
748 | 748 | | |
749 | 749 | | |
750 | 750 | | |
| |||
771 | 771 | | |
772 | 772 | | |
773 | 773 | | |
774 | | - | |
775 | | - | |
776 | | - | |
777 | | - | |
778 | 774 | | |
779 | 775 | | |
780 | 776 | | |
| |||
787 | 783 | | |
788 | 784 | | |
789 | 785 | | |
790 | | - | |
791 | | - | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
792 | 793 | | |
793 | 794 | | |
794 | 795 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3985 | 3985 | | |
3986 | 3986 | | |
3987 | 3987 | | |
3988 | | - | |
| 3988 | + | |
3989 | 3989 | | |
3990 | 3990 | | |
3991 | 3991 | | |
3992 | 3992 | | |
3993 | 3993 | | |
3994 | 3994 | | |
3995 | | - | |
| 3995 | + | |
3996 | 3996 | | |
3997 | 3997 | | |
3998 | 3998 | | |
| |||
0 commit comments