diff options
author | Juanma Barranquero <[email protected]> | 2014-04-30 21:54:52 +0200 |
---|---|---|
committer | Juanma Barranquero <[email protected]> | 2014-04-30 21:54:52 +0200 |
commit | 09b911adf4e22bbcac8c588bc14ade801276732e (patch) | |
tree | 0d9eb9708479bb491d7e1e2bb030aa3e90299526 /nt | |
parent | b0e36b7048c88aa24f6955c53fbe790bb9ebc54f (diff) | |
parent | 426b5dafdd837328d624a8ec5bfd567f2865c9f5 (diff) |
Merge from emacs-24; up to 2014-05-01T10:21:[email protected]
Diffstat (limited to 'nt')
-rw-r--r-- | nt/ChangeLog | 5 | ||||
-rw-r--r-- | nt/cmdproxy.c | 8 |
2 files changed, 11 insertions, 2 deletions
diff --git a/nt/ChangeLog b/nt/ChangeLog index 9e7773a742..f31d261931 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog @@ -1,3 +1,8 @@ +2014-04-30 Eli Zaretskii <[email protected]> + + * cmdproxy.c (make_absolute): Don't copy more characters from PATH + than a single directory name can hold. (Bug#17334) + 2014-04-22 Eli Zaretskii <[email protected]> * inc/ms-w32.h (lseek): Define only if not already a macro. diff --git a/nt/cmdproxy.c b/nt/cmdproxy.c index f3433f6368..e48ca63a25 100644 --- a/nt/cmdproxy.c +++ b/nt/cmdproxy.c @@ -292,11 +292,15 @@ make_absolute (const char *prog) while (*path) { + size_t len; + /* Get next directory from path. */ p = path; while (*p && *p != ';') p++; - strncpy (dir, path, p - path); - dir[p - path] = '\0'; + /* A broken PATH could have too long directory names in it. */ + len = min (p - path, sizeof (dir) - 1); + strncpy (dir, path, len); + dir[len] = '\0'; /* Search the directory for the program. */ if (search_dir (dir, prog, MAX_PATH, absname) > 0) |