diff options
author | Automerge script <automerge@asterisk.org> | 2012-11-29 17:19:50 +0000 |
---|---|---|
committer | Automerge script <automerge@asterisk.org> | 2012-11-29 17:19:50 +0000 |
commit | 93ec26e40affa4901c458e93b6d744915b1a850b (patch) | |
tree | 651c23a4eba22650e7cf798efea77a4fb9a21097 /channels | |
parent | 9b9da2938be01eeb62914a191d6125b594aea608 (diff) |
Merged revisions 376820-376821 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk
........
r376820 | pkiefer | 2012-11-29 10:44:42 -0600 (Thu, 29 Nov 2012) | 14 lines
Fix chan_sip websocket payload handling
Websocket by default doesn't return an ast_str for the payload received. When
converting it to an ast_str on chan_sip the last character was being omitted,
because ast_str functions expects that the given length includes the trailing
0x00. payload_len only has the actual string length without counting the
trailing zero.
For most cases this passed unnoticed as most of SIP messages ends with \r\n.
(closes issue ASTERISK-20745)
Reported by: I?\195?\177aki Baz Castillo
Review: https://reviewboard.asterisk.org/r/2219/
........
r376821 | dlee | 2012-11-29 11:16:50 -0600 (Thu, 29 Nov 2012) | 5 lines
Fixed ast_random's comment about locking.
The original comment was separated from the code at some point, and didn't
reflect the use of libc's other than glibc for Linux.
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376827 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_sip.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 44c8037ba..67c2a1c7c 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -2635,7 +2635,7 @@ static void sip_websocket_callback(struct ast_websocket *session, struct ast_var if (opcode == AST_WEBSOCKET_OPCODE_TEXT || opcode == AST_WEBSOCKET_OPCODE_BINARY) { struct sip_request req = { 0, }; - if (!(req.data = ast_str_create(payload_len))) { + if (!(req.data = ast_str_create(payload_len + 1))) { goto end; } |