Kaydet (Commit) a8aed02f authored tarafından Neal Norwitz's avatar Neal Norwitz

Make sure zip_path is null-terminated, since it's on the stack

üst ee711092
...@@ -467,6 +467,7 @@ calculate_path(void) ...@@ -467,6 +467,7 @@ calculate_path(void)
strncpy(zip_path, dllpath, MAXPATHLEN); strncpy(zip_path, dllpath, MAXPATHLEN);
else /* use name of executable program */ else /* use name of executable program */
strncpy(zip_path, progpath, MAXPATHLEN); strncpy(zip_path, progpath, MAXPATHLEN);
zip_path[MAXPATHLEN] = '\0';
len = strlen(zip_path); len = strlen(zip_path);
if (len > 4) { if (len > 4) {
zip_path[len-3] = 'z'; /* change ending to "zip" */ zip_path[len-3] = 'z'; /* change ending to "zip" */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment