[Asterisk-code-review] Serivce enum overrun (asterisk[master])

Badalian Vyacheslav asteriskteam at digium.com
Thu Dec 8 12:42:25 CST 2016


Badalian Vyacheslav has uploaded a new change for review. ( https://gerrit.asterisk.org/4595 )

Change subject: Serivce enum overrun
......................................................................

Serivce enum overrun

Array overrun is possible. The value of 'service' index could reach 3.

Change-Id: I8859f043113a839e2bdd6d631bd48bd896920174
---
M channels/chan_sip.c
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/95/4595/1

diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 7f22b96..c536778 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -1659,7 +1659,7 @@
 static enum ast_cc_service_type service_string_to_service_type(const char * const service_string)
 {
 	enum ast_cc_service_type service;
-	for (service = AST_CC_CCBS; service <= AST_CC_CCNL; ++service) {
+	for (service = AST_CC_CCBS; service < AST_CC_CCNL; ++service) {
 		if (!strcasecmp(service_string, sip_cc_service_map[service].service_string)) {
 			return service;
 		}

-- 
To view, visit https://gerrit.asterisk.org/4595
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8859f043113a839e2bdd6d631bd48bd896920174
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Badalian Vyacheslav <v.badalyan at open-bs.ru>



More information about the asterisk-code-review mailing list