rpm/rpm-filelist-bufferoverflow.diff

13 lines
334 B
Diff

--- build/files.c
+++ build/files.c
@@ -2053,7 +2053,8 @@ static int processPackageFiles(Spec spec, Package pkg,
continue;
fileName = NULL;
/*@-nullpass@*/ /* LCL: buf is NULL ?!? */
- strcpy(buf, s);
+ strncpy(buf, s, sizeof(buf)-1);
+ buf[sizeof(buf)-1] = '\0';
/*@=nullpass@*/
/* Reset for a new line in %files */