<p>Stefan Sperling has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/10645">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">fix unaligned access in abis_nm_rx_ipacc()<br><br>Related: OS#3496<br>Change-Id: Ia9bdce39472719bfebec29e0a55a021ef45c8ea6<br>---<br>M src/osmo-bsc/abis_nm.c<br>1 file changed, 6 insertions(+), 4 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/45/10645/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/osmo-bsc/abis_nm.c b/src/osmo-bsc/abis_nm.c</span><br><span>index 4757c72..93ca33a 100644</span><br><span>--- a/src/osmo-bsc/abis_nm.c</span><br><span>+++ b/src/osmo-bsc/abis_nm.c</span><br><span>@@ -29,6 +29,7 @@</span><br><span> #include <libgen.h></span><br><span> #include <time.h></span><br><span> #include <limits.h></span><br><span style="color: hsl(120, 100%, 40%);">+#include <inttypes.h></span><br><span> </span><br><span> #include <sys/stat.h></span><br><span> #include <netinet/in.h></span><br><span>@@ -2661,10 +2662,11 @@</span><br><span> </span><br><span>                      DEBUGPC(DNM, "IP=%s ", inet_ntoa(addr));</span><br><span>           }</span><br><span style="color: hsl(0, 100%, 40%);">-               if (TLVP_PRESENT(&tp, NM_ATT_IPACC_DST_IP_PORT))</span><br><span style="color: hsl(0, 100%, 40%);">-                    DEBUGPC(DNM, "PORT=%u ",</span><br><span style="color: hsl(0, 100%, 40%);">-                              ntohs(*((uint16_t *)</span><br><span style="color: hsl(0, 100%, 40%);">-                                    TLVP_VAL(&tp, NM_ATT_IPACC_DST_IP_PORT))));</span><br><span style="color: hsl(120, 100%, 40%);">+               if (TLVP_PRESENT(&tp, NM_ATT_IPACC_DST_IP_PORT)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                        uint16_t port;</span><br><span style="color: hsl(120, 100%, 40%);">+                        memcpy(&port, TLVP_VAL(&tp, NM_ATT_IPACC_DST_IP_PORT), sizeof(port));</span><br><span style="color: hsl(120, 100%, 40%);">+                 DEBUGPC(DNM, "PORT=%" SCNu16 " ", ntohs(port));</span><br><span style="color: hsl(120, 100%, 40%);">+           }</span><br><span>            if (TLVP_PRESENT(&tp, NM_ATT_IPACC_STREAM_ID))</span><br><span>                   DEBUGPC(DNM, "STREAM=0x%02x ",</span><br><span>                                     *TLVP_VAL(&tp, NM_ATT_IPACC_STREAM_ID));</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/10645">change 10645</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/10645"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-bsc </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ia9bdce39472719bfebec29e0a55a021ef45c8ea6 </div>
<div style="display:none"> Gerrit-Change-Number: 10645 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Stefan Sperling <ssperling@sysmocom.de> </div>