[asterisk-bugs] [Asterisk 0015495]: [patch] Asterisk runs over end of buffer reading manager input over HTTP and segfaults

Asterisk Bug Tracker noreply at bugs.digium.com
Wed Sep 9 02:20:45 CDT 2009


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=15495 
====================================================================== 
Reported By:                pdf
Assigned To:                tilghman
====================================================================== 
Project:                    Asterisk
Issue ID:                   15495
Category:                   Core/HTTP
Reproducibility:            sometimes
Severity:                   crash
Priority:                   normal
Status:                     ready for testing
Asterisk Version:           SVN 
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases):  1.4  
SVN Revision (number only!): 206284 
Request Review:              
====================================================================== 
Date Submitted:             2009-07-13 23:11 CDT
Last Modified:              2009-09-09 02:20 CDT
====================================================================== 
Summary:                    [patch] Asterisk runs over end of buffer reading
manager input over HTTP and segfaults
Description: 
We have a number of applications working over manager, and whilst I have
not been able to nail down what precisely is causing this, it has occurred
a number of times.  It looks like xml_translate is looking for a
null-terminated string, but the string is not always null-terminated, so it
runs off the end of the buffer and segfaults.
====================================================================== 

---------------------------------------------------------------------- 
 (0110400) pdf (reporter) - 2009-09-09 02:20
 https://issues.asterisk.org/view.php?id=15495#c110400 
---------------------------------------------------------------------- 
Since gcc generates a warning using this patch:

manager.c: In function ‘generic_http_callback’:
manager.c:2886: warning: zero-length printf format string

it's probably not a candidate for inclusion in the tree.

Shouldn't the null character really be added wherever that tmpfile is
being written to?  I don't understand why it is missing a null at this
point, because I haven't traced the code all the way back, but it concerns
me that it may be using an asterisk function that is also called elsewhere,
possibly resulting in a similar crash in another part of the code.  My
patch was only really meant as a band-aid for this case. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-09-09 02:20 pdf            Note Added: 0110400                          
======================================================================




More information about the asterisk-bugs mailing list