mirror of
https://github.com/SCST-project/scst.git
synced 2026-10-22 06:02:33 +00:00
iscsi-scstd: Supply an empty buffer when finalizing an AF_ALG hash
The saved Cppcheck report flags the zero-length final send: iscsi-scst/usr/af_alg.c:76: error: Null pointer dereference [nullPointer] Linux accepts a NULL buffer for this zero-length AF_ALG operation; this report does not establish a runtime dereference. Pass an empty string instead so the buffer contract is explicit without a model or waiver. The length remains zero and MSG_MORE remains clear, preserving hash finalization behavior.
This commit is contained in:
@@ -73,7 +73,7 @@ ssize_t af_alg_final(int datafd, void *out, size_t len)
|
||||
char buffer[1024];
|
||||
ssize_t res;
|
||||
|
||||
res = send(datafd, NULL, 0, 0);
|
||||
res = send(datafd, "", 0, 0);
|
||||
if (res == -1)
|
||||
return -errno;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user