[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [flashproxy/master] Return an error in case reading from the random source fails.
commit 6cb8179333bddf5aa14f934c5e0728b5af79dd68
Author: David Fifield <david@xxxxxxxxxxxxxxx>
Date: Tue Jan 29 14:14:20 2013 -0800
Return an error in case reading from the random source fails.
---
websocket-transport/websocket.go | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/websocket-transport/websocket.go b/websocket-transport/websocket.go
index 0e66405..b8c3e9d 100644
--- a/websocket-transport/websocket.go
+++ b/websocket-transport/websocket.go
@@ -231,6 +231,9 @@ func (ws *Websocket) WriteFrame(opcode byte, payload []byte) (err error) {
var maskKey [4]byte
if ws.IsClient {
_, err = io.ReadFull(rand.Reader, maskKey[:])
+ if err != nil {
+ return
+ }
applyMask(payload, maskKey)
maskBit = 0x80
} else {
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits