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:
Asterisk Autobuilder
2014-12-10 14:27:26 +00:00
parent cbd2d2f8eb
commit 3f72736966
3 changed files with 43 additions and 10 deletions

View File

@@ -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;
}