]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 3412] ctl_getitem(): Don't compare names past NUL
authorHarlan Stenn <stenn@ntp.org>
Fri, 13 Oct 2017 03:31:58 +0000 (03:31 +0000)
committerHarlan Stenn <stenn@ntp.org>
Fri, 13 Oct 2017 03:31:58 +0000 (03:31 +0000)
bk: 59e033aeB4GEMXOx6d1EF6zRwQSFYA

ChangeLog
ntpd/ntp_control.c

index 666008135915994c63f3ece34a8b57292eed5c76..774b275babcd33a8a5f00f4153f3ff5f4d07042b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 ---
 
+* [Bug 3412] ctl_getitem(): Don't compare names past NUL. <perlinger@ntp.org>
 * [Bug 3411] problem about SIGN(6) packet handling for ntp-4.2.8p10
   - raised receive buffer size to 1200 <perlinger@ntp.org>
 * [Bug 3408] refclock_jjy.c: Avoid a wrong report of the coverity static
index 4bc88644e8923271415cc53322561ede229b3143..1c2fae0e50118010190f411f2f8ca31b1cb383fd 100644 (file)
@@ -3130,7 +3130,9 @@ ctl_getitem(
                        const char *sp1 = reqpt;
                        const char *sp2 = v->text;
 
-                       while ((sp1 != tp) && (*sp1 == *sp2)) {
+                       /* [Bug 3412] do not compare past NUL byte in name */
+                       while (   (sp1 != tp)
+                              && ('\0' != *sp2) && (*sp1 == *sp2)) {
                                ++sp1;
                                ++sp2;
                        }