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

Friendly Automation asteriskteam at digium.com
Wed Mar 27 06:00:11 CDT 2019


Friendly Automation has submitted this change and it was merged. ( https://gerrit.asterisk.org/c/asterisk/+/11174 )

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
  Friendly Automation: Approved for Submit



diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index b5ee52e..b5bfad4 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -33182,7 +33182,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/+/11174
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: Ie706f21cee05f76ffb6f7d89e9c867930ee7bcd7
Gerrit-Change-Number: 11174
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/d91e9605/attachment.html>


More information about the asterisk-code-review mailing list