Commit 204c030
Andreas Gruenbacher
gfs2: Switch from strlcpy to strscpy
Switch from strlcpy to strscpy and make sure that @count is the size of
the smaller of the source and destination buffers. This prevents
reading beyond the end of the source buffer when the source string isn't
null terminated.
Found by a modified version of syzkaller.
Suggested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>1 parent 8693419 commit 204c030
1 file changed
+7
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
381 | 381 | | |
382 | 382 | | |
383 | 383 | | |
384 | | - | |
385 | | - | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
386 | 388 | | |
387 | 389 | | |
388 | 390 | | |
| |||
1439 | 1441 | | |
1440 | 1442 | | |
1441 | 1443 | | |
1442 | | - | |
| 1444 | + | |
1443 | 1445 | | |
1444 | 1446 | | |
1445 | | - | |
| 1447 | + | |
1446 | 1448 | | |
1447 | 1449 | | |
1448 | | - | |
| 1450 | + | |
1449 | 1451 | | |
1450 | 1452 | | |
1451 | 1453 | | |
| |||
0 commit comments