diff options
author | Mark Michelson <mmichelson@digium.com> | 2016-04-14 07:15:47 -0500 |
---|---|---|
committer | Mark Michelson <mmichelson@digium.com> | 2016-04-14 07:15:47 -0500 |
commit | 0b4bb19e0b432d41c23f3defc07abd56b45923ae (patch) | |
tree | fe84acb01a886c75247769d95d9bb64af95b5e3d /res/res_pjsip_outbound_registration.c | |
parent | 1f853df29cffa249ec3c423e3ce88c042c18021d (diff) |
AST-2016-004: Fix crash on REGISTER with long URI.
Due to some ignored return values, Asterisk could crash if processing an
incoming REGISTER whose contact URI was above a certain length.
ASTERISK-25707 #close
Reported by George Joseph
Patches:
0001-res_pjsip-Validate-that-URIs-don-t-exceed-pjproject-.patch
AST-2016-004
Change-Id: I0ed3898fe7ab10121b76c8c79046692de3a1be55
Diffstat (limited to 'res/res_pjsip_outbound_registration.c')
-rw-r--r-- | res/res_pjsip_outbound_registration.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/res/res_pjsip_outbound_registration.c b/res/res_pjsip_outbound_registration.c index 59c3db553..8a40cce23 100644 --- a/res/res_pjsip_outbound_registration.c +++ b/res/res_pjsip_outbound_registration.c @@ -1290,10 +1290,18 @@ static int sip_outbound_registration_apply(const struct ast_sorcery *sorcery, vo ast_log(LOG_ERROR, "No server URI specified on outbound registration '%s'\n", ast_sorcery_object_get_id(applied)); return -1; + } else if (ast_sip_validate_uri_length(applied->server_uri)) { + ast_log(LOG_ERROR, "Server URI or hostname length exceeds pjpropject limit '%s'\n", + ast_sorcery_object_get_id(applied)); + return -1; } else if (ast_strlen_zero(applied->client_uri)) { ast_log(LOG_ERROR, "No client URI specified on outbound registration '%s'\n", ast_sorcery_object_get_id(applied)); return -1; + } else if (ast_sip_validate_uri_length(applied->client_uri)) { + ast_log(LOG_ERROR, "Client URI or hostname length exceeds pjpropject limit '%s'\n", + ast_sorcery_object_get_id(applied)); + return -1; } else if (applied->line && ast_strlen_zero(applied->endpoint)) { ast_log(LOG_ERROR, "Line support has been enabled on outbound registration '%s' without providing an endpoint\n", ast_sorcery_object_get_id(applied)); |