CVS commit: src/external/bsd/ntp/dist/sntp/libopts/compat

"Robert Elz" <[email protected]>
Newsgroups gmane.os.netbsd.devel.cvs
Message-ID <[email protected]>
Module Name:	src
Committed By:	kre
Date:		Mon Apr 20 07:24:37 UTC 2026

Modified Files:
	src/external/bsd/ntp/dist/sntp/libopts/compat: pathfind.c

Log Message:
Fix overlapping strcpy usages

Using overlapping src & dest witgh strcpy is undefined, so anything
like
	strcpy(str + N, str + M);
is automatically invalid, regardless of the valuse of N and M.

Change offending usages here to use memmove() instead.

Note: 2 issues:  First, there is no (in sntp/compat) anything to deal
with the possibility that memmove() is not available - this should not
be a problem building nbsd, but it might be if any attempt were to be
made to upstream this change (the autoconf machinery to detect memmove()
would be needed, along wth a memmove() implementation).

Second, and more serious here, I haven't been able to get a build to
actually compile this code, so while I believe it is correct, I am unable
to test it.   This is intended to fix the sh3 builds on in the releng
daily builds, so we will see what happens.  As best I can tell my build
is essentially identical (though I would be using a different base system
for the build).


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 \
    src/external/bsd/ntp/dist/sntp/libopts/compat/pathfind.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.