aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--openbsc/src/nat/bsc_nat_utils.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/openbsc/src/nat/bsc_nat_utils.c b/openbsc/src/nat/bsc_nat_utils.c
index aba082d4d..b43d67a83 100644
--- a/openbsc/src/nat/bsc_nat_utils.c
+++ b/openbsc/src/nat/bsc_nat_utils.c
@@ -819,6 +819,12 @@ struct msgb *bsc_nat_rewrite_setup(struct bsc_nat *nat, struct msgb *msg, struct
return msg;
}
+ if (strlen(new_number) > sizeof(called.number)) {
+ LOGP(DNAT, LOGL_ERROR, "Number is too long for structure.\n");
+ talloc_free(new_number);
+ return msg;
+ }
+
/*
* Need to create a new message now based on the old onew
* with a new number. We can sadly not patch this in place