From 540ac847102d78f280948c6acd1c6c8b934a1f78 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 7 Oct 2008 00:00:15 +0000 Subject: [PATCH] bail on bad args git-svn-id: http://svn.openzap.org/svn/openzap/trunk@588 a93c3328-9c30-0410-af19-c9cd2b2d52af --- libs/openzap/src/ozmod/ozmod_analog/ozmod_analog.c | 3 +++ libs/openzap/src/ozmod/ozmod_analog_em/ozmod_analog_em.c | 3 +++ libs/openzap/src/ozmod/ozmod_isdn/ozmod_isdn.c | 3 +++ libs/openzap/src/ozmod/ozmod_ss7_boost/ozmod_ss7_boost.c | 3 +++ 4 files changed, 12 insertions(+) diff --git a/libs/openzap/src/ozmod/ozmod_analog/ozmod_analog.c b/libs/openzap/src/ozmod/ozmod_analog/ozmod_analog.c index 62d5f11a2b..ad6bd60b48 100644 --- a/libs/openzap/src/ozmod/ozmod_analog/ozmod_analog.c +++ b/libs/openzap/src/ozmod/ozmod_analog/ozmod_analog.c @@ -132,6 +132,9 @@ static ZIO_SIG_CONFIGURE_FUNCTION(zap_analog_configure_span) break; } hotline = val; + } else { + snprintf(span->last_error, sizeof(span->last_error), "Unknown parameter [%s]", var); + return ZAP_FAIL; } } diff --git a/libs/openzap/src/ozmod/ozmod_analog_em/ozmod_analog_em.c b/libs/openzap/src/ozmod/ozmod_analog_em/ozmod_analog_em.c index ed7f04b903..1d951ec65e 100644 --- a/libs/openzap/src/ozmod/ozmod_analog_em/ozmod_analog_em.c +++ b/libs/openzap/src/ozmod/ozmod_analog_em/ozmod_analog_em.c @@ -108,6 +108,9 @@ static ZIO_SIG_CONFIGURE_FUNCTION(zap_analog_em_configure_span) break; } max_dialstr = *intval; + } else { + snprintf(span->last_error, sizeof(span->last_error), "Unknown parameter [%s]", var); + return ZAP_FAIL; } } diff --git a/libs/openzap/src/ozmod/ozmod_isdn/ozmod_isdn.c b/libs/openzap/src/ozmod/ozmod_isdn/ozmod_isdn.c index 04e6eecdf3..c226d72aec 100644 --- a/libs/openzap/src/ozmod/ozmod_isdn/ozmod_isdn.c +++ b/libs/openzap/src/ozmod/ozmod_isdn/ozmod_isdn.c @@ -1750,6 +1750,9 @@ static ZIO_SIG_CONFIGURE_FUNCTION(zap_isdn_configure_span) } else if (q931loglevel > Q931_LOG_DEBUG) { q931loglevel = Q931_LOG_DEBUG; } + } else { + snprintf(span->last_error, sizeof(span->last_error), "Unknown parameter [%s]", var); + return ZAP_FAIL; } } diff --git a/libs/openzap/src/ozmod/ozmod_ss7_boost/ozmod_ss7_boost.c b/libs/openzap/src/ozmod/ozmod_ss7_boost/ozmod_ss7_boost.c index 9fe9b08292..656b09a9a5 100644 --- a/libs/openzap/src/ozmod/ozmod_ss7_boost/ozmod_ss7_boost.c +++ b/libs/openzap/src/ozmod/ozmod_ss7_boost/ozmod_ss7_boost.c @@ -1119,6 +1119,9 @@ static ZIO_SIG_CONFIGURE_FUNCTION(zap_ss7_boost_configure_span) break; } remote_port = *intval; + } else { + snprintf(span->last_error, sizeof(span->last_error), "Unknown parameter [%s]", var); + return ZAP_FAIL; } }