]> git.ipfire.org Git - thirdparty/make.git/commitdiff
* src/remake.c (name_mtime): Reserve space for nul in readlink result
authorTobias Stoeckmann <tobias@stoeckmann.org>
Sun, 12 Jul 2015 09:52:32 +0000 (11:52 +0200)
committerPaul Smith <psmith@gnu.org>
Sun, 28 Mar 2021 18:45:16 +0000 (14:45 -0400)
Copyright-paperwork-exempt: yes

src/remake.c

index 4d41e5d25ce48420845ca51c6c90e1d8e0ab1b70..dc3097c2be493b59a586023fe6232471cd8eb758 100644 (file)
@@ -1563,7 +1563,7 @@ name_mtime (const char *name)
             mtime = ltime;
 
           /* Set up to check the file pointed to by this link.  */
-          EINTRLOOP (llen, readlink (lpath, lbuf, GET_PATH_MAX));
+          EINTRLOOP (llen, readlink (lpath, lbuf, GET_PATH_MAX - 1));
           if (llen < 0)
             {
               /* Eh?  Just take what we have.  */