<p>Boris P. Korzun has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/19780">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">http.c: Fix NULL pointer dereference bug<br><br>If native HTTP is disabled but HTTPS is enabled and status page enabled<br>too, http is falling while loading. 'global_http_server' is referenced<br>to NULL, but the status page tries to dereference it.<br><br>The patch adds a check for HTTP is enabled.<br><br>ASTERISK-30379 #close<br><br>Change-Id: I11b02fc920b72aaed9c809fc43210523ccfdc249<br>---<br>M main/http.c<br>1 file changed, 26 insertions(+), 5 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/80/19780/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/main/http.c b/main/http.c</span><br><span>index 7f1ffe0..0f626e9 100644</span><br><span>--- a/main/http.c</span><br><span>+++ b/main/http.c</span><br><span>@@ -396,12 +396,16 @@</span><br><span> </span><br><span> ast_str_append(&out, 0, "<tr><td><i>Server</i></td><td><b>%s</b></td></tr>\r\n", http_server_name);</span><br><span> ast_str_append(&out, 0, "<tr><td><i>Prefix</i></td><td><b>%s</b></td></tr>\r\n", prefix);</span><br><span style="color: hsl(0, 100%, 40%);">- ast_str_append(&out, 0, "<tr><td><i>Bind Address</i></td><td><b>%s</b></td></tr>\r\n",</span><br><span style="color: hsl(0, 100%, 40%);">- ast_sockaddr_stringify_addr(&global_http_server->args.old_address));</span><br><span style="color: hsl(0, 100%, 40%);">- ast_str_append(&out, 0, "<tr><td><i>Bind Port</i></td><td><b>%s</b></td></tr>\r\n",</span><br><span style="color: hsl(0, 100%, 40%);">- ast_sockaddr_stringify_port(&global_http_server->args.old_address));</span><br><span style="color: hsl(120, 100%, 40%);">+ if (global_http_server) {</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_str_append(&out, 0, "<tr><td><i>Bind Address</i></td><td><b>%s</b></td></tr>\r\n",</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_sockaddr_stringify_addr(&global_http_server->args.old_address));</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_str_append(&out, 0, "<tr><td><i>Bind Port</i></td><td><b>%s</b></td></tr>\r\n",</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_sockaddr_stringify_port(&global_http_server->args.old_address));</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span> if (http_tls_cfg.enabled) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_str_append(&out, 0, "<tr><td><i>SSL Bind Port</i></td><td><b>%s</b></td></tr>\r\n",</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_str_append(&out, 0, "<tr><td><i>TLS Bind Address</i></td><td><b>%s</b></td></tr>\r\n",</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_sockaddr_stringify_addr(&https_desc.old_address));</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_str_append(&out, 0, "<tr><td><i>TLS Bind Port</i></td><td><b>%s</b></td></tr>\r\n",</span><br><span> ast_sockaddr_stringify_port(&https_desc.old_address));</span><br><span> }</span><br><span> ast_str_append(&out, 0, "<tr><td colspan=\"2\"><hr></td></tr>\r\n");</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/19780">change 19780</a>. To unsubscribe, or for help writing mail filters, 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/c/asterisk/+/19780"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 18 </div>
<div style="display:none"> Gerrit-Change-Id: I11b02fc920b72aaed9c809fc43210523ccfdc249 </div>
<div style="display:none"> Gerrit-Change-Number: 19780 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Boris P. Korzun <drtr0jan@yandex.ru> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>