cvs: php4 /ext/xml xml.c

From: Date: Sat, 18 Aug 2001 23:43:04 +0000
Subject: cvs: php4 /ext/xml xml.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-6948@lists.php.net to get a copy of this message
sniper Sat Aug 18 19:43:04 2001 EDT Modified files: /php4/ext/xml xml.c Log: null terminate the returned string in here too. Index: php4/ext/xml/xml.c diff -u php4/ext/xml/xml.c:1.93 php4/ext/xml/xml.c:1.94 --- php4/ext/xml/xml.c:1.93 Sat Aug 18 19:07:10 2001 +++ php4/ext/xml/xml.c Sat Aug 18 19:43:04 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: xml.c,v 1.93 2001/08/18 23:07:10 sniper Exp $ */ +/* $Id: xml.c,v 1.94 2001/08/18 23:43:04 sniper Exp $ */ #define IS_EXT_MODULE @@ -462,9 +462,10 @@ if (encoder == NULL) { /* If no encoder function was specified, return the data as-is. */ - newbuf = emalloc(len); + newbuf = emalloc(len + 1); memcpy(newbuf, s, len); *newlen = len; + newbuf[*newlen] = '\0'; return newbuf; } /* This is the theoretical max (will never get beyond len * 2 as long

« previous php.cvs (#6948) next »