]> git.ipfire.org Git - thirdparty/make.git/commit
Avoid overwriting buffers with long pathnames
authorPaul Smith <psmith@gnu.org>
Fri, 17 Jun 2022 23:55:11 +0000 (19:55 -0400)
committerPaul Smith <psmith@gnu.org>
Fri, 17 Jun 2022 23:55:11 +0000 (19:55 -0400)
commit97e51c0285109ebb6bf8be3d1e21cb0bd5058e5a
tree8f510cde04c25f9f3c0a57fa73ee2495d43a30f3
parent59abb46bc9a4e4845c2797e17b5986eb2d528649
Avoid overwriting buffers with long pathnames

Reported, with initial patch, by Gisle Vanem <gvanem@online.no>

* src/main.c (find_and_set_default_shell) [W32]: Pass search_token
directly to w32ify: no need to make a copy first.  When we need to
construct a path, use snprintf() to be sure we don't overwrite
the locally-allocated buffer.
* src/w32/pathstuff.c (w32ify) [W32]: Use the malloc version of
_fullpath(), followed by strncpy(), to avoid overwriting buffers.
src/main.c
src/w32/pathstuff.c