summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-01-16 19:44:47 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2020-01-17 14:41:58 +0100
commit2734e1c38cf30094cbb8b24025031ced8396d92b (patch)
tree2b846e12cae410e7942def2a5ca995f3b9373b43
parent5a7eb34f735e0ae93a74da3bc8361454457e49cd (diff)
sccp: Support receiving messages with no optional params
-rw-r--r--src/sccp2sua.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/sccp2sua.c b/src/sccp2sua.c
index b829cf6..2be27ea 100644
--- a/src/sccp2sua.c
+++ b/src/sccp2sua.c
@@ -705,6 +705,12 @@ static struct xua_msg *sccp_to_xua_opt(struct msgb *msg, uint8_t *ptr_opt, struc
/* some bounds checking */
if (ptr_opt < msg->data || ptr_opt > msg->tail)
return NULL;
+
+ /* Q.713 section 2.3 "Coding of pointers": pointer value all zeros used
+ to indicate that no optional param is present. */
+ if (*ptr_opt == 0)
+ return xua;
+
opt_start = ptr_opt + *ptr_opt;
if (opt_start > msg->tail)
return NULL;