<p>Jenkins2 <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/7667">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Sean Bright: Looks good to me, but someone else must approve
Richard Mudgett: Looks good to me, but someone else must approve
Joshua Colp: Looks good to me, approved
Jenkins2: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">dns_core: Protect against array index violation.<br><br>Add a check to allocate_dns_record to prevent calling a pointer<br>retrieved from beyond dns_alloc_table.<br><br>ASTERISK-27495 #close<br><br>Change-Id: Ie2f6e4991cea46baa12e837bd64cc22b44d322bb<br>---<br>M main/dns_core.c<br>1 file changed, 6 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/main/dns_core.c b/main/dns_core.c<br>index a243b4b..3e270af 100644<br>--- a/main/dns_core.c<br>+++ b/main/dns_core.c<br>@@ -447,9 +447,13 @@<br> [T_SRV] = dns_srv_alloc,<br> };<br> <br>-static struct ast_dns_record *allocate_dns_record(int rr_type, struct ast_dns_query *query, const char *data, const size_t size)<br>+static struct ast_dns_record *allocate_dns_record(unsigned int rr_type, struct ast_dns_query *query, const char *data, const size_t size)<br> {<br>- dns_alloc_fn allocator = dns_alloc_table[rr_type] ?: generic_record_alloc;<br>+ dns_alloc_fn allocator = generic_record_alloc;<br>+<br>+ if (rr_type < ARRAY_LEN(dns_alloc_table) && dns_alloc_table[rr_type]) {<br>+ allocator = dns_alloc_table[rr_type];<br>+ }<br> <br> return allocator(query, data, size);<br> }<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/7667">change 7667</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/7667"/><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: Ie2f6e4991cea46baa12e837bd64cc22b44d322bb </div>
<div style="display:none"> Gerrit-Change-Number: 7667 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.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: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Sean Bright <sean.bright@gmail.com> </div>