[Asterisk-code-review] res pjsip/pjsip configuration: Disregard empty auth values (asterisk[13])

Matt Jordan asteriskteam at digium.com
Sun Aug 23 18:41:27 CDT 2015


Matt Jordan has uploaded a new change for review.

  https://gerrit.asterisk.org/1128

Change subject: res_pjsip/pjsip_configuration: Disregard empty auth values
......................................................................

res_pjsip/pjsip_configuration: Disregard empty auth values

When an endpoint is backed by a non-static conf file backend (such as
the AstDB or Realtime), the 'auth' object may be returned as being an
empty string. Currently, res_pjsip will interpret that as being a valid
auth object, and will attempt to authenticate inbound requests. This
isn't desired; is an auth value is empty (which the name of an auth
object cannot be), we should instead interpret that as being an invalid
auth object and skip it.

ASTERISK-25339 #close

Change-Id: Ic32b0c6eb5575107d5164a8c40099e687cd722c7
---
M res/res_pjsip/pjsip_configuration.c
1 file changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/28/1128/1

diff --git a/res/res_pjsip/pjsip_configuration.c b/res/res_pjsip/pjsip_configuration.c
index c0c96ad..13839a1 100644
--- a/res/res_pjsip/pjsip_configuration.c
+++ b/res/res_pjsip/pjsip_configuration.c
@@ -406,6 +406,10 @@
 		if (!val) {
 			goto failure;
 		}
+		if (ast_strlen_zero(val)) {
+			ast_free(val);
+			continue;
+		}
 		if (AST_VECTOR_APPEND(auths, val)) {
 			goto failure;
 		}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic32b0c6eb5575107d5164a8c40099e687cd722c7
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Matt Jordan <mjordan at digium.com>



More information about the asterisk-code-review mailing list