aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNikolay Dimitrov <ndimitrov@setelis.com>2013-12-21 10:22:17 +0800
committerAndy Green <andy.green@linaro.org>2013-12-21 10:22:17 +0800
commita8268e761905ba5ab65686b378d824c994135266 (patch)
tree75e2d72a4a0deffee6bb88a6fb029699d0765ea4 /lib
parent0a0a7ebc372af8f85c4aec21e2300b62f1b3ffa3 (diff)
downloadlibwebsockets-a8268e761905ba5ab65686b378d824c994135266.tar.gz
fix dropmask dereference even when NULL
Signed-off-by: Nikolay Dimitrov <ndimitrov@setelis.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/output.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/output.c b/lib/output.c
index c8e85a56..990cc6c2 100644
--- a/lib/output.c
+++ b/lib/output.c
@@ -555,14 +555,15 @@ do_more_inside_frame:
/*
* in v7, just mask the payload
*/
- for (n = 4; n < (int)len + 4; n++)
- dropmask[n] = dropmask[n] ^
+ if (dropmask) { /* never set if already inside frame */
+ for (n = 4; n < (int)len + 4; n++)
+ dropmask[n] = dropmask[n] ^
wsi->u.ws.frame_masking_nonce_04[
(wsi->u.ws.frame_mask_index++) & 3];
- if (dropmask) /* never set if already inside frame */
/* copy the frame nonce into place */
memcpy(dropmask, wsi->u.ws.frame_masking_nonce_04, 4);
+ }
}
send_raw: