summaryrefslogtreecommitdiff
path: root/res/res_pjsip/pjsip_configuration.c
diff options
context:
space:
mode:
authorMatt Jordan <mjordan@digium.com>2015-08-23 18:26:50 -0500
committerMatt Jordan <mjordan@digium.com>2015-08-23 18:41:55 -0500
commitbc6fe07f5c114bdeaef4a3b83a11faaa9d1046eb (patch)
tree1ccf7841a76dc29dd55bf791a0df5096677cee3d /res/res_pjsip/pjsip_configuration.c
parentab373f2ceffcad3a497663027199f4f4a81f644b (diff)
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
Diffstat (limited to 'res/res_pjsip/pjsip_configuration.c')
-rw-r--r--res/res_pjsip/pjsip_configuration.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/res/res_pjsip/pjsip_configuration.c b/res/res_pjsip/pjsip_configuration.c
index c0c96ad7f..2fdfc9d0b 100644
--- a/res/res_pjsip/pjsip_configuration.c
+++ b/res/res_pjsip/pjsip_configuration.c
@@ -402,6 +402,10 @@ int ast_sip_auth_vector_init(struct ast_sip_auth_vector *auths, const char *valu
}
while ((val = strsep(&auth_names, ","))) {
+ if (ast_strlen_zero(val)) {
+ continue;
+ }
+
val = ast_strdup(val);
if (!val) {
goto failure;