aboutsummaryrefslogtreecommitdiffstats
path: root/channels/sip
diff options
context:
space:
mode:
authorjrose <jrose@f38db490-d61c-443f-a65b-d21fe96a405b>2011-05-27 16:35:49 +0000
committerjrose <jrose@f38db490-d61c-443f-a65b-d21fe96a405b>2011-05-27 16:35:49 +0000
commitb98d7249b74ec65c6afb16c40aefc3699386c0ce (patch)
tree7ee0a4cab68d9c88049c3bc3caa4382b7b97f2b4 /channels/sip
parente1c5ddc93e13ce03130ca47006af5ab2359d31cc (diff)
Merged revisions 321273 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r321273 | jrose | 2011-05-27 09:59:34 -0500 (Fri, 27 May 2011) | 3 lines markm committed a patch I was working on yesterday, this fixes it to mesh up with suggestions by mnicholson. ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@321289 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/sip')
-rw-r--r--channels/sip/reqresp_parser.c38
1 files changed, 21 insertions, 17 deletions
diff --git a/channels/sip/reqresp_parser.c b/channels/sip/reqresp_parser.c
index 6cab6f149..6c7031730 100644
--- a/channels/sip/reqresp_parser.c
+++ b/channels/sip/reqresp_parser.c
@@ -42,25 +42,29 @@ int parse_uri_full(char *uri, const char *scheme, char **user, char **pass,
char *c = NULL;
int error = 0;
+ /*
+ * Initialize requested strings - some functions don't care if parse_uri fails
+ * and will attempt to use string pointers passed into parse_uri even after a
+ * parse_uri failure
+ */
+ if (user) {
+ *user = "";
+ }
+ if (pass) {
+ *pass = "";
+ }
+ if (domain) {
+ *domain = "";
+ }
+ if (headers) {
+ *headers = "";
+ }
+ if (residue) {
+ *residue = "";
+ }
+
/* check for valid input */
if (ast_strlen_zero(uri)) {
- /* make sure we leave nothing undefined after we exit */
- if (user) {
- *user = "";
- }
- if (pass) {
- *pass = "";
- }
- if (domain) {
- *domain = "";
- }
- if (headers) {
- *headers = "";
- }
- if (residue) {
- *residue = "";
- }
-
return -1;
}