<p>Stefan Sperling <strong>uploaded patch set #2</strong> to this change.</p><p><a href="https://gerrit.osmocom.org/11861">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">replace bogus memcpy() call in ippool_newip()<br><br>When copying an address to a reused static hash table member<br>with memcpy(), this code mistakenly passed the size of a<br>pointer as the amount of bytes to be copied, rather than<br>the actual size of the address.<br><br>This means the IP pool could contain bogus IP addresses because<br>only addr->len (a uint8_t) and 3 further bytes of the address<br>were actually copied on 32 bit platforms. On 64 bit platforms,<br>a sufficient amount of bytes were copied for IPv4 to work<br>correctly, but too few bytes were copied for IPv6.<br><br>This problem was found by Coverity.<br><br>Replace the bogus memcpy() call with direct assignments to the<br>appropriate struct in64addr union members, and assert that the<br>length recorded for the address actually corresponds to the<br>length used by the address family (IP4, IPv6).<br><br>Change-Id: Ic21560f7519e776107485a8779702fb1279d065c<br>Related: CID#57921<br>---<br>M lib/ippool.c<br>1 file changed, 9 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/61/11861/2</pre><p>To view, visit <a href="https://gerrit.osmocom.org/11861">change 11861</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.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.osmocom.org/11861"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-ggsn </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newpatchset </div>
<div style="display:none"> Gerrit-Change-Id: Ic21560f7519e776107485a8779702fb1279d065c </div>
<div style="display:none"> Gerrit-Change-Number: 11861 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Stefan Sperling <ssperling@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>
<div style="display:none"> Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Pau Espin Pedrol <pespin@sysmocom.de> </div>