Skip to content

Commit 369653e

Browse files
ericatpureNicholas Bellinger
authored andcommitted
iscsi-target: fix extract_param to handle buffer length corner case
extract_param() is called with max_length set to the total size of the output buffer. It's not safe to allow a parameter length equal to the buffer size as the terminating null would be written one byte past the end of the output buffer. Signed-off-by: Eric Seppanen <[email protected]> Cc: <[email protected]> #3.1+ Signed-off-by: Nicholas Bellinger <[email protected]>
1 parent d1fa7a1 commit 369653e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/target/iscsi/iscsi_target_nego.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ int extract_param(
8888
if (len < 0)
8989
return -1;
9090

91-
if (len > max_length) {
91+
if (len >= max_length) {
9292
pr_err("Length of input: %d exceeds max_length:"
9393
" %d\n", len, max_length);
9494
return -1;

0 commit comments

Comments
 (0)