summaryrefslogtreecommitdiff
path: root/res/res_http_websocket.c
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2014-12-19 20:54:23 +0000
committerRichard Mudgett <rmudgett@digium.com>2014-12-19 20:54:23 +0000
commit4b054bdc6dfce762cdb26608bd7a7b90484150ba (patch)
treef97e1370b858d391064d6c37fa2c6fbf8881bbc3 /res/res_http_websocket.c
parent7074bf956b1ec215b55176c5f0137924450a2749 (diff)
res_http_websocket.c: Fix incorrect use of sizeof in ast_websocket_write().
This won't fix the reported issue but it is an incorrect use of sizeof. ASTERISK-24566 Reported by: Badalian Vyacheslav ........ Merged revisions 429867 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@429868 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_http_websocket.c')
-rw-r--r--res/res_http_websocket.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/res/res_http_websocket.c b/res/res_http_websocket.c
index 400e5eb1c..4930bcc42 100644
--- a/res/res_http_websocket.c
+++ b/res/res_http_websocket.c
@@ -273,7 +273,7 @@ int AST_OPTIONAL_API_NAME(ast_websocket_write)(struct ast_websocket *session, en
{
size_t header_size = 2; /* The minimum size of a websocket frame is 2 bytes */
char *frame;
- uint64_t length = 0;
+ uint64_t length;
if (actual_length < 126) {
length = actual_length;
@@ -288,7 +288,7 @@ int AST_OPTIONAL_API_NAME(ast_websocket_write)(struct ast_websocket *session, en
}
frame = ast_alloca(header_size);
- memset(frame, 0, sizeof(*frame));
+ memset(frame, 0, header_size);
frame[0] = opcode | 0x80;
frame[1] = length;