<p>Jenkins2 <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/8130">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Corey Farrell: Looks good to me, but someone else must approve
Joshua Colp: Looks good to me, but someone else must approve
Sean Bright: Looks good to me, approved
Jenkins2: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">manager.c: Fix potential memory leak and corruption.<br><br>ast_str_append_event_header() could potentially leak and corrupt memory if<br>the ast_str needed to expand to add the AMI event header.<br><br>* Fixed to return error if the ast_str_append() failed.<br><br>Change-Id: I92f36b855540743b208d76e274152ee2d758176d<br>---<br>M main/manager.c<br>1 file changed, 5 insertions(+), 12 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/main/manager.c b/main/manager.c<br>index 576978c..a97f208 100644<br>--- a/main/manager.c<br>+++ b/main/manager.c<br>@@ -9490,23 +9490,16 @@<br> }<br> <br> int ast_str_append_event_header(struct ast_str **fields_string,<br>- const char *header, const char *value)<br>+ const char *header, const char *value)<br> {<br>- struct ast_str *working_str = *fields_string;<br>-<br>- if (!working_str) {<br>- working_str = ast_str_create(128);<br>- if (!working_str) {<br>+ if (!*fields_string) {<br>+ *fields_string = ast_str_create(128);<br>+ if (!*fields_string) {<br> return -1;<br> }<br>- *fields_string = working_str;<br> }<br> <br>- ast_str_append(&working_str, 0,<br>- "%s: %s\r\n",<br>- header, value);<br>-<br>- return 0;<br>+ return (ast_str_append(fields_string, 0, "%s: %s\r\n", header, value) < 0) ? -1 : 0;<br> }<br> <br> static void manager_event_blob_dtor(void *obj)<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/8130">change 8130</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/8130"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 15 </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I92f36b855540743b208d76e274152ee2d758176d </div>
<div style="display:none"> Gerrit-Change-Number: 8130 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Sean Bright <sean.bright@gmail.com> </div>