[asterisk-commits] tilghman: branch 1.6.0 r226167 - in /branches/1.6.0: ./ main/manager.c

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


Author: tilghman
Date: Tue Oct 27 15:23:54 2009
New Revision: 226167

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=226167
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.0/   (props changed)
    branches/1.6.0/main/manager.c

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

Modified: branches/1.6.0/main/manager.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.0/main/manager.c?view=diff&rev=226167&r1=226166&r2=226167
==============================================================================
--- branches/1.6.0/main/manager.c (original)
+++ branches/1.6.0/main/manager.c Tue Oct 27 15:23:54 2009
@@ -3674,9 +3674,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 (MAP_FAILED == (buf = mmap(NULL, l, PROT_READ | PROT_WRITE, MAP_PRIVATE, s.fd, 0))) {
 				ast_log(LOG_WARNING, "mmap failed.  Manager output was not processed\n");
 			} else {




More information about the asterisk-commits mailing list