Skip to content

Commit 65ce61a

Browse files
jeff-lien-sndkigaw
authored andcommitted
sndk: avoid buffer overflow when reading file name
Limit the size of a file name string to the declared size. Signed-off-by: jeff-lien-sndk <[email protected]>
1 parent 6e00716 commit 65ce61a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

plugins/sandisk/sandisk-nvme.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ static int sndk_vs_internal_fw_log(int argc, char **argv,
476476
timeInfo.second);
477477
snprintf(fileSuffix, PATH_MAX, "_internal_fw_log_%s", (char *)timeStamp);
478478

479-
ret = sndk_get_serial_name(hdl, f, PATH_MAX, fileSuffix);
479+
ret = sndk_get_serial_name(hdl, f, PATH_MAX-5, fileSuffix);
480480
if (ret) {
481481
fprintf(stderr, "ERROR: SNDK: failed to generate file name\n");
482482
goto out;

0 commit comments

Comments
 (0)