[Asterisk-code-review] res pjsip: Fail global load if debug is empty (asterisk[14])
George Joseph
asteriskteam at digium.com
Thu Aug 11 12:22:22 CDT 2016
George Joseph has uploaded a new change for review.
https://gerrit.asterisk.org/3501
Change subject: res_pjsip: Fail global load if debug is empty
......................................................................
res_pjsip: Fail global load if debug is empty
If debug was specified in the global configuration but left blank,
the logger would treat it as a wildcard and log all hosts. The global
apply handler now checks for an empty string.
ASTERISK-26239 #close
Change-Id: Ie75727f5cd5808845d92cc81f5713842fb203336
---
M res/res_pjsip/config_global.c
1 file changed, 6 insertions(+), 0 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/01/3501/1
diff --git a/res/res_pjsip/config_global.c b/res/res_pjsip/config_global.c
index 8a1b0d4..d972993 100644
--- a/res/res_pjsip/config_global.c
+++ b/res/res_pjsip/config_global.c
@@ -118,6 +118,12 @@
struct global_config *cfg = obj;
char max_forwards[10];
+ if (ast_strlen_zero(cfg->debug)) {
+ ast_log(LOG_ERROR,
+ "Global option 'debug' can't be empty if specified. It must be 'yes', 'no', a hostname or an ip address\n");
+ return -1;
+ }
+
snprintf(max_forwards, sizeof(max_forwards), "%u", cfg->max_forwards);
ast_sip_add_global_request_header("Max-Forwards", max_forwards, 1);
--
To view, visit https://gerrit.asterisk.org/3501
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie75727f5cd5808845d92cc81f5713842fb203336
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 14
Gerrit-Owner: George Joseph <gjoseph at digium.com>
More information about the asterisk-code-review
mailing list