Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nathelper: Fix rare message corruption due to bitwise opts on strings
Credits to Damien Sandras for the report and initial PR! Closes #2695
- Loading branch information
1 parent
447a88a
commit ecbd985
Showing
2 changed files
with
45 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ecbd985
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, @liviuchircu
Don't you think, that
p = proto2str(s->proto, proto_str);
we got pointer to the last symbol in the string with proto name, but herep = proto2upper(s->proto, proto_str);
we get pointer to the first symbol in the proto name. So as the result we havest = " "
And resulting VIA:
Via: SIP/2.0/ 155.75.20.81:5060;branch=z9hG4bK....
ecbd985
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are absolutely correct, @vasilevalex. I was simply blind to this behavior of the function, despite it being written in the function docs: "The new resulting pointer will be returned". Let me fix this as a matter of urgency, before the release!
ecbd985
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 54bb91a, @vasilevalex. Thank you for the review!