Commit bcf9f9eb authored by Neal Norwitz's avatar Neal Norwitz

SF # 602108 ensure string is null terminated after strncpy

parent 12e96689
...@@ -407,6 +407,7 @@ calculate_path(void) ...@@ -407,6 +407,7 @@ calculate_path(void)
if (progpath[0] != SEP) if (progpath[0] != SEP)
absolutize(progpath); absolutize(progpath);
strncpy(argv0_path, progpath, MAXPATHLEN); strncpy(argv0_path, progpath, MAXPATHLEN);
argv0_path[MAXPATHLEN] = '\0';
#ifdef WITH_NEXT_FRAMEWORK #ifdef WITH_NEXT_FRAMEWORK
/* On Mac OS X we have a special case if we're running from a framework. /* On Mac OS X we have a special case if we're running from a framework.
......
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