From 5831af3fe22f2143d34421d0918bd1140b93b599 Mon Sep 17 00:00:00 2001 From: Miika Turkia Date: Sun, 7 Dec 2014 21:36:54 +0200 Subject: [PATCH] Fix a crash on CSV import Seems that there was not enough space reserved for the whole mem buffer when adding XML tags around CSV file. When unlucky, the metadata of memory allocation was overwritten. Signed-off-by: Miika Turkia Signed-off-by: Dirk Hohndel --- file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file.c b/file.c index d733613f1..d85661080 100644 --- a/file.c +++ b/file.c @@ -116,7 +116,7 @@ static int try_to_xslt_open_csv(const char *filename, struct memblock *mem, cons * * Tag markers take: strlen("<>") = 5 */ - buf = realloc(mem->buffer, mem->size + 5 + strlen(tag) * 2); + buf = realloc(mem->buffer, mem->size + 6 + strlen(tag) * 2); if (buf != NULL) { char *starttag = NULL; char *endtag = NULL;