mirror of
https://github.com/asterisk/asterisk.git
synced 2026-05-05 21:04:01 +00:00
Merge r429271 for AST-2014-019
git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/tags/11.6-cert9@429306 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -2604,12 +2604,16 @@ 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, };
|
||||
char data[payload_len + 1];
|
||||
|
||||
if (!(req.data = ast_str_create(payload_len + 1))) {
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (ast_str_set(&req.data, -1, "%s", payload) == AST_DYNSTR_BUILD_FAILED) {
|
||||
strncpy(data, payload, payload_len);
|
||||
data[payload_len] = '\0';
|
||||
|
||||
if (ast_str_set(&req.data, -1, "%s", data) == AST_DYNSTR_BUILD_FAILED) {
|
||||
deinit_req(&req);
|
||||
goto end;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user