neels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-iuh/+/32613 )
Change subject: fix leak in ranap_new_transp_layer_addr()
......................................................................
fix leak in ranap_new_transp_layer_addr()
Like BIT_STRING_fromBuf(), free any buffer previously kept in the target
BIT_STRING_t.
Context: osmo-hnbgw calls ranap_new_transp_layer_addr() to replace an
address in a decoded message, before re-encoding it. So far doing so
leaked the previous buffer.
Change-Id: Ic92fa317644c3a1f2be9badf455d34fe0b8ea2a4
---
M src/iu_helpers.c
1 file changed, 18 insertions(+), 0 deletions(-)
Approvals:
Jenkins Builder: Verified
pespin: Looks good to me, but someone else must approve
msuraev: Looks good to me, but someone else must approve
neels: Looks good to me, approved
diff --git a/src/iu_helpers.c b/src/iu_helpers.c
index 6e2c203..718c30a 100644
--- a/src/iu_helpers.c
+++ b/src/iu_helpers.c
@@ -217,6 +217,8 @@
buf = CALLOC(len, sizeof(uint8_t));
memcpy(buf, ip_addr, ip_len);
}
+ if (out->buf)
+ FREEMEM(out->buf);
out->buf = buf;
out->size = len;
out->bits_unused = 0;
--
To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/32613
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Change-Id: Ic92fa317644c3a1f2be9badf455d34fe0b8ea2a4
Gerrit-Change-Number: 32613
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: msuraev <msuraev(a)sysmocom.de>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: daniel <dwillmann(a)sysmocom.de>
Gerrit-MessageType: merged
Attention is currently required from: daniel.
neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-iuh/+/32613 )
Change subject: fix leak in ranap_new_transp_layer_addr()
......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
> Maybe also rename the function to ranap_replace_transp_layer_addr() ?
would be a good name, but this is public API of libosmo-ranap. imho the current name is not bad enough to do the work of changing public API and adjusting all callers...
--
To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/32613
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Change-Id: Ic92fa317644c3a1f2be9badf455d34fe0b8ea2a4
Gerrit-Change-Number: 32613
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: msuraev <msuraev(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: daniel <dwillmann(a)sysmocom.de>
Gerrit-Attention: daniel <dwillmann(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 08 May 2023 13:28:17 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: daniel <dwillmann(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: neels.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-hnbgw/+/32620
to look at the new patch set (#3).
Change subject: move main() to separate file
......................................................................
move main() to separate file
Conform to recent osmocom practice by having an osmo_hnbgw_main.c file
for main() and its immediate infrastructure.
Prepares for adding a non-installed libhnbgw.la -- which must not
contain a main() function -- so that linking regression tests is easy.
Separating to a new file seems appropriate because hnbgw.c has gathered
a bunch of stuff that is not strictly main() related / might be useful
to access in a C test.
Change-Id: I5f26a6b68f0d380617d73371f40f3b9055cac362
---
M include/osmocom/hnbgw/hnbgw.h
M src/osmo-hnbgw/Makefile.am
M src/osmo-hnbgw/hnbgw.c
A src/osmo-hnbgw/osmo_hnbgw_main.c
4 files changed, 417 insertions(+), 379 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/20/32620/3
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/32620
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I5f26a6b68f0d380617d73371f40f3b9055cac362
Gerrit-Change-Number: 32620
Gerrit-PatchSet: 3
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: newpatchset