Module Name:    src
Committed By:   mrg
Date:           Wed Jun 22 03:59:50 UTC 2011

Modified Files:
        src/external/bsd/ntp/dist/ntpd: refclock_parse.c

Log Message:
fix a potential off-by-two array overflow found by GCC 4.5.3.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/ntp/dist/ntpd/refclock_parse.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/refclock_parse.c
diff -u src/external/bsd/ntp/dist/ntpd/refclock_parse.c:1.3 src/external/bsd/ntp/dist/ntpd/refclock_parse.c:1.4
--- src/external/bsd/ntp/dist/ntpd/refclock_parse.c:1.3	Sat Dec  4 23:08:35 2010
+++ src/external/bsd/ntp/dist/ntpd/refclock_parse.c	Wed Jun 22 03:59:49 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: refclock_parse.c,v 1.3 2010/12/04 23:08:35 christos Exp $	*/
+/*	$NetBSD: refclock_parse.c,v 1.4 2011/06/22 03:59:49 mrg Exp $	*/
 
 /*
  * /src/NTP/REPOSITORY/ntp4-dev/ntpd/refclock_parse.c,v 4.81 2009/05/01 10:15:29 kardel RELEASE_20090105_A
@@ -2455,7 +2455,7 @@
 		{
 			if (buffer[0])
 				strncat(buffer, "; ", size);
-			strncat(buffer, flagstrings[i].name, size);
+			strncat(buffer, flagstrings[i].name, size - 2);
 		}
 		i++;
 	}

Reply via email to