Commit f46b064
linux: avoid segfault in check-tls-key due to null hostnqn/subsysnqn
Running nvme check-tls-key hits a segfault as seen below:
nvme check-tls-key
-d NVMeTLSkey-1:01:bB7soUnpHfxVg53sCY21KY3nLbqLit2RcIO8Rbdf3mKhcKaM:
Segmentation fault (core dumped)
This is because the strlen check on subsysnqn or hostnqn crashes at
src/nvme/linux.c due to either of them being null. Avoid this segfault
by checking these strings before running a strlen on them.
Signed-off-by: Martin George <[email protected]>1 parent 11d0a89 commit f46b064
1 file changed
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1104 | 1104 | | |
1105 | 1105 | | |
1106 | 1106 | | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
1107 | 1112 | | |
1108 | 1113 | | |
1109 | 1114 | | |
| |||
0 commit comments