[Asterisk-code-review] chan_sip: Ensure 'qualifygap' isn't negative (...asterisk[13])

Joshua Colp asteriskteam at digium.com
Wed Mar 27 06:00:04 CDT 2019


Joshua Colp has submitted this change and it was merged. ( https://gerrit.asterisk.org/c/asterisk/+/11172 )

Change subject: chan_sip: Ensure 'qualifygap' isn't negative
......................................................................

chan_sip: Ensure 'qualifygap' isn't negative

Passing negative intervals to the scheduler rips a hole in the
space-time continuum.

ASTERISK-25792 #close
Reported by: Paul Sandys

Change-Id: Ie706f21cee05f76ffb6f7d89e9c867930ee7bcd7
---
M channels/chan_sip.c
1 file changed, 2 insertions(+), 1 deletion(-)

Approvals:
  George Joseph: Looks good to me, but someone else must approve
  Benjamin Keith Ford: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved; Approved for Submit



diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index ac922fa..ce88e52 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -32900,7 +32900,8 @@
 				ast_log(LOG_WARNING, "Usage of SIP_CAUSE is deprecated.  Please use HANGUPCAUSE instead.\n");
 			}
 		} else if (!strcasecmp(v->name, "qualifygap")) {
-			if (sscanf(v->value, "%30d", &global_qualify_gap) != 1) {
+			if (sscanf(v->value, "%30d", &global_qualify_gap) != 1
+				|| global_qualify_gap < 0) {
 				ast_log(LOG_WARNING, "Invalid qualifygap '%s' at line %d of %s\n", v->value, v->lineno, config);
 				global_qualify_gap = DEFAULT_QUALIFY_GAP;
 			}

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/11172
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Change-Id: Ie706f21cee05f76ffb6f7d89e9c867930ee7bcd7
Gerrit-Change-Number: 11172
Gerrit-PatchSet: 1
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
Gerrit-Reviewer: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190327/359c5675/attachment.html>


More information about the asterisk-code-review mailing list