|
From: <sv...@va...> - 2006-12-26 04:29:19
|
Author: sewardj
Date: 2006-12-26 04:29:17 +0000 (Tue, 26 Dec 2006)
New Revision: 6435
Log:
Merge r6417: Always ensure that the output buffer is zero-terminated,
even if it is already full. (Nick N)
Modified:
branches/VALGRIND_3_2_BRANCH/coregrind/m_libcprint.c
Modified: branches/VALGRIND_3_2_BRANCH/coregrind/m_libcprint.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/VALGRIND_3_2_BRANCH/coregrind/m_libcprint.c 2006-12-26 04:09=
:33 UTC (rev 6434)
+++ branches/VALGRIND_3_2_BRANCH/coregrind/m_libcprint.c 2006-12-26 04:29=
:17 UTC (rev 6435)
@@ -168,6 +168,8 @@
b->buf[b->buf_used++] =3D c;
if (b->buf_used < b->buf_size)
b->buf[b->buf_used] =3D 0;
+ else
+ b->buf[b->buf_size-1] =3D 0; /* pre: b->buf_size > 0 */
}=20
}
=20
|