projects
/
xboard.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
a6cb149
)
Fix crash in auto-comment
author
H.G. Muller
<h.g.muller@hccnet.nl>
Tue, 3 Jan 2012 10:29:00 +0000 (11:29 +0100)
committer
H.G. Muller
<h.g.muller@hccnet.nl>
Tue, 3 Jan 2012 20:37:56 +0000 (21:37 +0100)
Trailing linefeeds in AppendComment were not properly stripped off,
leading to a mismatch between the allocted and used memory, and thus
possible buffer overruns.
backend.c
patch
|
blob
|
history
diff --git
a/backend.c
b/backend.c
index
a3b0f0c
..
02cc45e
100644
(file)
--- a/
backend.c
+++ b/
backend.c
@@
-14903,6
+14903,7
@@
if(appData.debugMode) fprintf(debugFP, "Append: in='%s' %d\n", text, addBraces);
while (*text == '\n') text++;
len = strlen(text);
while (len > 0 && text[len - 1] == '\n') len--;
+ text[len] = NULLCHAR;
if (len == 0) return;