From: Harlan Stenn Date: Fri, 13 Oct 2017 03:31:58 +0000 (+0000) Subject: [Bug 3412] ctl_getitem(): Don't compare names past NUL X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0ebdb61f1f7e5fd5425d9bc70a6bc027512ef34c;p=thirdparty%2Fntp.git [Bug 3412] ctl_getitem(): Don't compare names past NUL bk: 59e033aeB4GEMXOx6d1EF6zRwQSFYA --- diff --git a/ChangeLog b/ChangeLog index 666008135..774b275ba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ --- +* [Bug 3412] ctl_getitem(): Don't compare names past NUL. * [Bug 3411] problem about SIGN(6) packet handling for ntp-4.2.8p10 - raised receive buffer size to 1200 * [Bug 3408] refclock_jjy.c: Avoid a wrong report of the coverity static diff --git a/ntpd/ntp_control.c b/ntpd/ntp_control.c index 4bc88644e..1c2fae0e5 100644 --- a/ntpd/ntp_control.c +++ b/ntpd/ntp_control.c @@ -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; }