Module Name: src
Committed By: rmind
Date: Sun Oct 3 19:41:25 UTC 2010
Modified Files:
src/regress/sys/net/frag: ip4_frag_1.c
Log Message:
Don't overrun the buffer, when writing some payload.
To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/regress/sys/net/frag/ip4_frag_1.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/regress/sys/net/frag/ip4_frag_1.c
diff -u src/regress/sys/net/frag/ip4_frag_1.c:1.1 src/regress/sys/net/frag/ip4_frag_1.c:1.2
--- src/regress/sys/net/frag/ip4_frag_1.c:1.1 Tue Jul 13 22:13:18 2010
+++ src/regress/sys/net/frag/ip4_frag_1.c Sun Oct 3 19:41:25 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: ip4_frag_1.c,v 1.1 2010/07/13 22:13:18 rmind Exp $ */
+/* $NetBSD: ip4_frag_1.c,v 1.2 2010/10/03 19:41:25 rmind Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -126,7 +126,8 @@
n = 0;
}
for (data += n; n < addlen; n++) {
- data[n] = (0xf & n);
+ *data = (0xf & n);
+ data++;
}
return (void *)ip;
}