Change in libosmocore[master]: gsm/abis_nm.c: account \0 in abis_nm_put_sw_desc()

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Thu Apr 18 20:26:01 UTC 2019


Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13702


Change subject: gsm/abis_nm.c: account \0 in abis_nm_put_sw_desc()
......................................................................

gsm/abis_nm.c: account \0 in abis_nm_put_sw_desc()

Change-Id: Id10b1bcb39ef0af296cd3f4d5e7ebe210b7a3a27
---
M src/gsm/abis_nm.c
1 file changed, 3 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/02/13702/1

diff --git a/src/gsm/abis_nm.c b/src/gsm/abis_nm.c
index a4c0e41..ac4e6e7 100644
--- a/src/gsm/abis_nm.c
+++ b/src/gsm/abis_nm.c
@@ -791,8 +791,9 @@
 uint16_t abis_nm_put_sw_file(struct msgb *msg, const char *id, const char *ver, bool put_sw_desc)
 {
 	struct abis_nm_sw_desc sw = {
-		.file_id_len = strlen(id),
-		.file_version_len = strlen(ver),
+		/* We should also account \0 */
+		.file_id_len = strlen(id) + 1,
+		.file_version_len = strlen(ver) + 1,
 	};
 
 	memcpy(sw.file_id, id, sw.file_id_len);

-- 
To view, visit https://gerrit.osmocom.org/13702
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id10b1bcb39ef0af296cd3f4d5e7ebe210b7a3a27
Gerrit-Change-Number: 13702
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190418/f675204f/attachment.html>


More information about the gerrit-log mailing list