From: Alan T. DeKok Date: Thu, 9 Sep 2010 12:33:03 +0000 (+0200) Subject: Ensure we leave room for the trailing NUL X-Git-Tag: release_3_0_0_beta0~1261 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=freeradius.git;a=commitdiff_plain;h=671bde96d7e9e68b8dbf871db4d9ded33964a4d4 Ensure we leave room for the trailing NUL --- diff --git a/src/main/conffile.c b/src/main/conffile.c index 4feed80..ee47afb 100644 --- a/src/main/conffile.c +++ b/src/main/conffile.c @@ -2589,7 +2589,7 @@ int cf_pair2xml(FILE *fp, const CONF_PAIR *cp) char *p = buffer; const char *q = cp->value; - while (*q && (p < (buffer + sizeof(buffer)))) { + while (*q && (p < (buffer + sizeof(buffer) - 1))) { if (q[0] == '&') { memcpy(p, "&", 4); p += 5;