Skip to content
Snippets Groups Projects
Commit d3e0cd62 authored by Tristan Matthews's avatar Tristan Matthews
Browse files

libiax2: avoid unaligned access

This was causing crash due to SIGBUS on ARM

Refs #52428

Change-Id: I189fbf32902fd1b0ba9c870c0fd1437c8a4a0f6c
parent bbb005ab
Branches
Tags
No related merge requests found
...@@ -2764,8 +2764,13 @@ static struct iax_event *iax_header_to_event(struct iax_session *session, struct ...@@ -2764,8 +2764,13 @@ static struct iax_event *iax_header_to_event(struct iax_session *session, struct
/* so a full voice frame is sent on the /* so a full voice frame is sent on the
next voice output */ next voice output */
session->svoiceformat = -1; session->svoiceformat = -1;
session->transfer = *e->ies.apparent_addr;
/* don't shallow copy struct by assignment (this avoids
* unaligned accesses) */
session->transfer.sin_port = e->ies.apparent_addr->sin_port;
session->transfer.sin_addr = e->ies.apparent_addr->sin_addr;
session->transfer.sin_family = AF_INET; session->transfer.sin_family = AF_INET;
session->transfercallno = e->ies.callno; session->transfercallno = e->ies.callno;
session->transferring = TRANSFER_BEGIN; session->transferring = TRANSFER_BEGIN;
session->transferid = e->ies.transferid; session->transferid = e->ies.transferid;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment