projects
/
capablanca.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
ec2e35c
)
Limit length of lines sent to timeseal decoder
author
H.G. Muller
<h.g.muller@hccnet.nl>
Mon, 25 Feb 2013 12:42:58 +0000 (13:42 +0100)
committer
H.G. Muller
<h.g.muller@hccnet.nl>
Mon, 25 Feb 2013 12:42:58 +0000 (13:42 +0100)
The timeseal decoder seems to crash on lines longer than 1000 characters.
lasker-2.2.3/src/timeseal.c
patch
|
blob
|
history
diff --git
a/lasker-2.2.3/src/timeseal.c
b/lasker-2.2.3/src/timeseal.c
index
02d3c4f
..
baeea06
100644
(file)
--- a/
lasker-2.2.3/src/timeseal.c
+++ b/
lasker-2.2.3/src/timeseal.c
@@
-31,9
+31,11
@@
static unsigned decode(unsigned char *s)
char line[1024];
char *p;
unsigned t = 0;
+
+ snprintf(line, 1000, "%s", s); // [HGM] limit length to 1000, to prevent crashing timeseal decoder
/* send the encoded data to the decoder process */
- dprintf(timeseal_globals.decoder_conn, "%s\n", s);
+ dprintf(timeseal_globals.decoder_conn, "%s\n", line);
if (!fd_gets(line, sizeof(line), timeseal_globals.decoder_conn)) {
d_printf("Bad result from timeseal decoder? (t=%u)\n", t);