Blame SOURCES/unzip-6.0-COVSCAN-strcpy-with-overlapping-strings.patch

7e0a4d
From 8f6be666289211661906922cdfe6ea5a08c5b458 Mon Sep 17 00:00:00 2001
7e0a4d
From: Jakub Martisko <jamartis@redhat.com>
7e0a4d
Date: Tue, 13 Nov 2018 09:57:43 +0100
7e0a4d
Subject: [PATCH] envargs.c: strcpy with overlapping strings
7e0a4d
7e0a4d
---
7e0a4d
 envargs.c | 4 +++-
7e0a4d
 1 file changed, 3 insertions(+), 1 deletion(-)
7e0a4d
7e0a4d
diff --git a/envargs.c b/envargs.c
7e0a4d
index f0a230d..daa3e47 100644
7e0a4d
--- a/envargs.c
7e0a4d
+++ b/envargs.c
7e0a4d
@@ -31,6 +31,7 @@
7e0a4d
 #define __ENVARGS_C     /* identifies this source module */
7e0a4d
 #define UNZIP_INTERNAL
7e0a4d
 #include "unzip.h"
7e0a4d
+#include <string.h>
7e0a4d
 
7e0a4d
 #ifdef __EMX__          /* emx isspace() returns TRUE on extended ASCII !! */
7e0a4d
 #  define ISspace(c) ((c) & 0x80 ? 0 : isspace((unsigned)c))
7e0a4d
@@ -118,7 +119,8 @@ int envargs(Pargc, Pargv, envstr, envstr2)
7e0a4d
 
7e0a4d
             /* remove escape characters */
7e0a4d
             while ((argstart = MBSCHR(argstart, '\\')) != (char *)NULL) {
7e0a4d
-                strcpy(argstart, argstart + 1);
7e0a4d
+                //strcpy(argstart, argstart + 1);
7e0a4d
+		memmove(argstart, argstart + 1,strlen(argstart + 1) + 1);
7e0a4d
                 if (*argstart)
7e0a4d
                     ++argstart;
7e0a4d
             }
7e0a4d
-- 
7e0a4d
2.14.5
7e0a4d