sgpio/sgpio-1.2-coverity.patch
Troy Dawson 9b65796146 RHEL 9.0.0 Alpha bootstrap
The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/sgpio#ed2830a9ca891cb86278a048cbcc7883295b18c7
2020-10-15 09:32:47 -07:00

17 lines
404 B
Diff

Assume buffer overflow even if it's not possible.
Found by coverity.
Author: Jan Synacek <jsynacek@redhat.com>
--- sgpio/sgpio.c.orig 2012-11-30 14:14:09.000000000 +0100
+++ sgpio/sgpio.c 2012-11-30 14:14:17.437228466 +0100
@@ -629,7 +629,7 @@
return -1;
}
- strcpy(location, sys_scsi_path);
+ strncpy(location, sys_scsi_path, FS_PATH_LEN);
len = strlen(location);
for(i=0;i<dir_qan;i++){