From: Frank Kardel Date: Sat, 18 Mar 2006 14:20:27 +0000 (+0000) Subject: refclock_arc.c: X-Git-Tag: NTP_4_2_1P10_RC~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=59afada5c923d15d0891c5122c4ba127908358f2;p=thirdparty%2Fntp.git refclock_arc.c: buffer bounds: buffer full condition wrong for bounds check (Coverity CID 1508 NetBSD Scan 5) bk: 441c172bm0I09gfbwcY160SIMq7k2Q --- diff --git a/ntpd/refclock_arc.c b/ntpd/refclock_arc.c index 43328aa19..af8062192 100644 --- a/ntpd/refclock_arc.c +++ b/ntpd/refclock_arc.c @@ -818,7 +818,7 @@ send_slow( } /* Copy in the command to be sent. */ - while(*s) { up->cmdqueue[CMDQUEUELEN - spaceleft--] = *s++; } + while(*s && spaceleft > 0) { up->cmdqueue[CMDQUEUELEN - spaceleft--] = *s++; } return(1); }