Browse code

core: main - set ending 0 in allocated cfg file path

(cherry picked from commit 15f57ceae26b967ad92dd3a97ebcd869d1197244)
(cherry picked from commit 38d72250f4c9c77bee71262b6c340503cc9a92a2)

Daniel-Constantin Mierla authored on 15/04/2021 08:28:24 • Henning Westerholt committed on 22/10/2021 11:52:54
Showing 1 changed files
... ...
@@ -1265,7 +1265,7 @@ int fix_cfg_file(void)
1265 1265
 		}
1266 1266
 		if ((res = malloc(cfg_len + 1)) == NULL) goto error;
1267 1267
 		memcpy(res, cfg_file, cfg_len);
1268
-		cfg_file[cfg_len] = 0;
1268
+		res[cfg_len] = 0;
1269 1269
 		cfg_file = res;
1270 1270
 		return 0;
1271 1271
 	}