From c245d8f55ee094707771e5225dd91564ded4630c Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Tue, 3 Jan 2012 11:29:00 +0100 Subject: [PATCH] Fix crash in auto-comment 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 | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/backend.c b/backend.c index a3b0f0c..02cc45e 100644 --- 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; -- 1.7.0.4