Commit f7ba8bf
fabrics: fix potential invalid memory access in __nvmf_supported_option()
In __nvmf_supported_option(), len is declared as size_t (unsigned)
"len = read()" may return a negative number;
the check "if (len < 0)" will always be false and therefore
"buf[len]" will dereference an invalid memory address.
len should be declared as a signed size_t (ssize_t)
Signed-off-by: Maurizio Lombardi <[email protected]>1 parent 2aaf2ed commit f7ba8bf
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
625 | 625 | | |
626 | 626 | | |
627 | 627 | | |
628 | | - | |
| 628 | + | |
629 | 629 | | |
630 | 630 | | |
631 | 631 | | |
| |||
0 commit comments