Commit 0290a4b
committed
fabrics: Avoid out of bounds string chomping
Update all callsides of nvme_chomp to use the correct max lenght of
the string to avoid out of bounds access.
While at it, nvme_chomp() is used by fabrics.c to sanitize the traddr
and trsvcid. There is no user outside of fabrics and clearly this is a
small helper function. Thus move it to fabrics and rename it to a more
comon name strchomp.
Signed-off-by: Daniel Wagner <[email protected]>1 parent c8f2472 commit 0290a4b
2 files changed
Lines changed: 15 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
49 | 60 | | |
50 | 61 | | |
51 | 62 | | |
| |||
567 | 578 | | |
568 | 579 | | |
569 | 580 | | |
570 | | - | |
571 | | - | |
| 581 | + | |
| 582 | + | |
572 | 583 | | |
573 | 584 | | |
574 | 585 | | |
| |||
583 | 594 | | |
584 | 595 | | |
585 | 596 | | |
586 | | - | |
| 597 | + | |
587 | 598 | | |
588 | 599 | | |
589 | 600 | | |
| |||
595 | 606 | | |
596 | 607 | | |
597 | 608 | | |
598 | | - | |
| 609 | + | |
599 | 610 | | |
600 | 611 | | |
601 | 612 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | 233 | | |
245 | 234 | | |
246 | 235 | | |
| |||
0 commit comments