[PATCH 1/3] ipaccess-config: exit if no network interface is specified

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/OpenBSC@lists.osmocom.org/.

pablo at gnumonks.org pablo at gnumonks.org
Tue Apr 5 16:45:17 UTC 2011


From: Pablo Neira Ayuso <pablo at gnumonks.org>

ipaccess-config has to exit if no network interface is specified,
otherwise it uses argv[1] which has a uninitialized value.
---
 openbsc/src/ipaccess/ipaccess-find.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/openbsc/src/ipaccess/ipaccess-find.c b/openbsc/src/ipaccess/ipaccess-find.c
index 6dc2f06..a273609 100644
--- a/openbsc/src/ipaccess/ipaccess-find.c
+++ b/openbsc/src/ipaccess/ipaccess-find.c
@@ -196,6 +196,7 @@ int main(int argc, char **argv)
 	if (argc < 2) {
 		fprintf(stdout, "you might need to specify the outgoing\n"
 			" network interface, e.g. ``%s eth0''\n", argv[0]);
+		exit(EXIT_FAILURE);
 	}
 
 	ifname = argv[1];
-- 
1.7.2.3





More information about the OpenBSC mailing list