[OpenSIPS-Devel] [opensips] Do not append colon if uri password is NULL (#598)

Jarrod Baumann notifications at github.com
Wed Aug 12 06:09:49 CEST 2015


I agree with @brettnem's assessment of the problem with #593.  As @liviuchircu pointed out, this pull requests addresses the problem in `do_action.c:1032` where a colon is blindly added if the user exists without consideration for the presence of an actual password... it attempts a memcpy on a NULL pointer no less (albeit with a length of 0).

I think if `parse_uri(tmp, len, &uri)<0)` finds an actual semi colon after the user and the password IS indeed blank, uri.password.s should be initialized to an empty string `""` instead of NULL so that `do_action.c:1032` check passes and the current behavior .  But otherwise, if the password is NULL, the colon should not be appended.

This should satisfy the userinfo requirements as well as fix the issue presented.

Thoughts?

You can view, comment on, or merge this pull request online at:

  https://github.com/OpenSIPS/opensips/pull/598

-- Commit Summary --

  * Do not append colon if uri password is NULL

-- File Changes --

    M action.c (2)

-- Patch Links --

https://github.com/OpenSIPS/opensips/pull/598.patch
https://github.com/OpenSIPS/opensips/pull/598.diff

---
Reply to this email directly or view it on GitHub:
https://github.com/OpenSIPS/opensips/pull/598
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/devel/attachments/20150811/fad52ab3/attachment.htm>


More information about the Devel mailing list