[asterisk-commits] tilghman: branch 1.6.2 r226170 - in /branches/1.6.2: ./ main/manager.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Oct 27 15:24:13 CDT 2009


Author: tilghman
Date: Tue Oct 27 15:24:08 2009
New Revision: 226170

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=226170
Log:
Merged revisions 226159 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
  r226159 | tilghman | 2009-10-27 15:22:07 -0500 (Tue, 27 Oct 2009) | 14 lines
  
  Merged revisions 226138 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r226138 | tilghman | 2009-10-27 15:16:49 -0500 (Tue, 27 Oct 2009) | 7 lines
    
    Manager output is not always NULL-terminated, so force a NULL at the end of the filestream.
    (closes issue #15495)
     Reported by: pdf
     Patches: 
           20090916__issue15495.diff.txt uploaded by tilghman (license 14)
     Tested by: pdf
  ........
................

Modified:
    branches/1.6.2/   (props changed)
    branches/1.6.2/main/manager.c

Propchange: branches/1.6.2/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.2/main/manager.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/main/manager.c?view=diff&rev=226170&r1=226169&r2=226170
==============================================================================
--- branches/1.6.2/main/manager.c (original)
+++ branches/1.6.2/main/manager.c Tue Oct 27 15:24:08 2009
@@ -3918,9 +3918,12 @@
 
 	if (s.f != NULL) {	/* have temporary output */
 		char *buf;
-		size_t l = ftell(s.f);
+		size_t l;
 		
-		if (l) {
+		/* Ensure buffer is NULL-terminated */
+		fprintf(s.f, "%c", 0);
+
+		if ((l = ftell(s.f))) {
 			if ((buf = mmap(NULL, l, PROT_READ | PROT_WRITE, MAP_SHARED, s.fd, 0))) {
 				if (format == FORMAT_XML || format == FORMAT_HTML)
 					xml_translate(&out, buf, params, format);




More information about the asterisk-commits mailing list