Blame SOURCES/1-fix-snprintf-truncation.patch

1e3e47
--- utils/qzip.c.orig
1e3e47
+++ utils/qzip.c
1e3e47
@@ -469,9 +469,8 @@ int makeOutName(const char *in_name, const char *out_name,
1e3e47
  * parent directory. */
1e3e47
 void mkPath(char *path, const char *dirpath, char *file)
1e3e47
 {
1e3e47
-    if (strlen(dirpath) + strlen(file) + 1 < MAX_PATH_LEN) {
1e3e47
-        snprintf(path, MAX_PATH_LEN, "%s/%s", dirpath, file);
1e3e47
-    } else {
1e3e47
+    if (snprintf(path, MAX_PATH_LEN, "%s/%s", dirpath, file) >= MAX_PATH_LEN) {
1e3e47
+        /* truncation occurred */
1e3e47
         assert(0);
1e3e47
     }
1e3e47
 }