Commit 001a2cb
server: trim extra '\0's in bytes_to_cstr()
Currently bytes_to_cstr() expects one and only one '\0' and the end of
the buffer, but we've seen lookup request with name buffer having
multiple '\0's at the end and caused failures.
To make it more robust, trim extra zeros in buffer, this also follows
what virtiofsd does.
Signed-off-by: Eryu Guan <eguan@linux.alibaba.com>1 parent 0144710 commit 001a2cb
1 file changed
+15
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1395 | 1395 | | |
1396 | 1396 | | |
1397 | 1397 | | |
1398 | | - | |
1399 | | - | |
1400 | | - | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
1401 | 1413 | | |
1402 | 1414 | | |
1403 | 1415 | | |
| |||
0 commit comments