From 2734e1c38cf30094cbb8b24025031ced8396d92b Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Thu, 16 Jan 2020 19:44:47 +0100 Subject: sccp: Support receiving messages with no optional params Change-Id: I745bd32c62763ba2d88e74de8644c171ef506b37 --- src/sccp2sua.c | 6 ++++++ 1 file changed, 6 insertions(+) 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; -- cgit v1.2.3