pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/libosmo-sigtran/+/43422?usp=email )


Change subject: sua: sua_addr_parse_get(): Propagate failure from sua_parse_gt()
......................................................................

sua: sua_addr_parse_get(): Propagate failure from sua_parse_gt()

As a result, addresses with > 31 digits would be silently trimmed and
accepted.

Also, remove the par_datalen check, sua_parse_gt() already takes care of
it.

Change-Id: Ia9d33d313b272e5b230be68eccb8e14ff739d9a4
---
M src/sua.c
1 file changed, 1 insertion(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran 
refs/changes/22/43422/1

diff --git a/src/sua.c b/src/sua.c
index 0784b61..f3ed921 100644
--- a/src/sua.c
+++ b/src/sua.c
@@ -857,9 +857,8 @@
                        out->presence |= OSMO_SCCP_ADDR_T_SSN;
                        break;
                case SUA_IEI_GT:
-                       if (par_datalen < 8)
+                       if (sua_parse_gt(&out->gt, par->data, par_datalen) < 0)
                                goto subpar_fail;
-                       sua_parse_gt(&out->gt, par->data, par_datalen);
                        out->presence |= OSMO_SCCP_ADDR_T_GT;
                        break;
                case SUA_IEI_IPv4:

--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/43422?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: Ia9d33d313b272e5b230be68eccb8e14ff739d9a4
Gerrit-Change-Number: 43422
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <[email protected]>

Reply via email to