[MERGED] openbsc[master]: Fix possible non-null-terminated buffer

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Sat Nov 26 18:39:52 UTC 2016


Harald Welte has submitted this change and it was merged.

Change subject: Fix possible non-null-terminated buffer
......................................................................


Fix possible non-null-terminated buffer

Change-Id: I22100c260856991b9a836135b3650e5b8c5449ca
Fixes: Coverity CID 57623
---
M openbsc/src/libmsc/vty_interface_layer3.c
1 file changed, 1 insertion(+), 0 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/openbsc/src/libmsc/vty_interface_layer3.c b/openbsc/src/libmsc/vty_interface_layer3.c
index 6f0006c..0b360b8 100644
--- a/openbsc/src/libmsc/vty_interface_layer3.c
+++ b/openbsc/src/libmsc/vty_interface_layer3.c
@@ -568,6 +568,7 @@
 	}
 
 	strncpy(subscr->name, name, sizeof(subscr->name));
+	subscr->name[sizeof(subscr->name)-1] = '\0';
 	talloc_free(name);
 	db_sync_subscriber(subscr);
 

-- 
To view, visit https://gerrit.osmocom.org/1312
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I22100c260856991b9a836135b3650e5b8c5449ca
Gerrit-PatchSet: 2
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list