<p>George Joseph <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/11637">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Kevin Harwell: Looks good to me, but someone else must approve
Corey Farrell: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved; Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">loader.c: Fix possible SEGV when a module fails to register<br><br>When a module fails to register itself (usually a coding error<br>in the module), dlerror() can return NULL. We weren't checking<br>for that in load_dlopen() before trying to strdup the error message<br>so a SEGV was thrown. dlerror() is now surrounded with an S_OR<br>so we don't SEGV.<br><br>Change-Id: Ie0fb9316f08a321434f3f85aecf3c7d2ede8b956<br>---<br>M main/loader.c<br>1 file changed, 1 insertion(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/main/loader.c b/main/loader.c</span><br><span>index b46f745..033693e 100644</span><br><span>--- a/main/loader.c</span><br><span>+++ b/main/loader.c</span><br><span>@@ -1087,7 +1087,7 @@</span><br><span> if (resource_being_loaded) {</span><br><span> struct ast_str *list;</span><br><span> int c = 0;</span><br><span style="color: hsl(0, 100%, 40%);">- const char *dlerror_msg = ast_strdupa(dlerror());</span><br><span style="color: hsl(120, 100%, 40%);">+ const char *dlerror_msg = ast_strdupa(S_OR(dlerror(), ""));</span><br><span> </span><br><span> resource_being_loaded = NULL;</span><br><span> if (mod->lib) {</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/11637">change 11637</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/+/11637"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-Change-Id: Ie0fb9316f08a321434f3f85aecf3c7d2ede8b956 </div>
<div style="display:none"> Gerrit-Change-Number: 11637 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>