diff options
author | obrien <obrien@FreeBSD.org> | 2002-04-13 19:36:47 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2002-04-13 19:36:47 +0000 |
commit | 49304db55852bc90e479a43967196c47376c37a9 (patch) | |
tree | 509f9e0d0e55d98ce918a13da65c3665bb2c95fd /usr.bin/make/str.c | |
parent | a06013eb4e2cd400e5859e6a23daa9e8fbd10608 (diff) | |
download | FreeBSD-src-49304db55852bc90e479a43967196c47376c37a9.zip FreeBSD-src-49304db55852bc90e479a43967196c47376c37a9.tar.gz |
Revision 1.17 seems to break a subsequent buildworld (i.e. with the new
make installed) in gnu/usr.bin/groff/src/preproc/eqn (which, being a
build tool itself, is built with the original make during buildworld).
The problem seems to be that in str_concat(), the string is not
terminated when the length of the second string is 0.
This apparently can happen during null suffix rule processing.
Submitted by: tmm
Diffstat (limited to 'usr.bin/make/str.c')
-rw-r--r-- | usr.bin/make/str.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/make/str.c b/usr.bin/make/str.c index 87557a8..03ff7a4a 100644 --- a/usr.bin/make/str.c +++ b/usr.bin/make/str.c @@ -112,9 +112,12 @@ str_concat(s1, s2, flags) result[len1++] = '/'; } - /* copy second string plus EOS into place */ + /* copy second string into place */ if (len2) - memcpy(result + len1, s2, len2 + 1); + memcpy(result + len1, s2, len2); + + /* Terminate. */ + result[len1 + len2] = '\0'; /* free original strings */ if (flags & STR_DOFREE) { |