Change in osmo-ggsn[master]: gtp_echo_responder: report invalid chars present in node-feautres cmd...

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/.

pespin gerrit-no-reply at lists.osmocom.org
Fri Oct 8 15:29:28 UTC 2021


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ggsn/+/25728 )


Change subject: gtp_echo_responder: report invalid chars present in node-feautres cmdline arg as error
......................................................................

gtp_echo_responder: report invalid chars present in node-feautres cmdline arg as error

from "man strtoul":
"""
If endptr is not NULL, strtoul() stores the address of the first invalid character in *endptr.
In particular, if *nptr is not '\0' but **endptr is '\0' on return, the entire string is valid.
"""

Fixes: ae81195418ebed5280d0753d037df483bb914a0b
Change-Id: I89d26a575ef81ee17483db035924354588d9d094
---
M utils/gtp_echo_responder.c
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/28/25728/1

diff --git a/utils/gtp_echo_responder.c b/utils/gtp_echo_responder.c
index e077c81..390fa25 100644
--- a/utils/gtp_echo_responder.c
+++ b/utils/gtp_echo_responder.c
@@ -125,7 +125,7 @@
 
 	res = strtoul(arg, &end, 0);
 	if ((errno == ERANGE && res == ULONG_MAX) || (errno && !res) ||
-	    arg == end) {
+	    arg == end || *end != '\0') {
 		fprintf(stderr, "Failed parsing Node Features bitmask: '%s'\n", arg);
 		exit(1);
 	}

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/25728
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Change-Id: I89d26a575ef81ee17483db035924354588d9d094
Gerrit-Change-Number: 25728
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20211008/a5e156a7/attachment.htm>


More information about the gerrit-log mailing list