]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
refclock_arc.c:
authorFrank Kardel <kardel@ntp.org>
Sat, 18 Mar 2006 14:20:27 +0000 (14:20 +0000)
committerFrank Kardel <kardel@ntp.org>
Sat, 18 Mar 2006 14:20:27 +0000 (14:20 +0000)
  buffer bounds: buffer full condition wrong for bounds check (Coverity CID 1508 NetBSD Scan 5)

bk: 441c172bm0I09gfbwcY160SIMq7k2Q

ntpd/refclock_arc.c

index 43328aa196e9622e82aaea8b29e0966514b10d29..af80621926cc1eb79fbaf4842723244ee2bdb64b 100644 (file)
@@ -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);
 }