mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
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 <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
19c75b878c
commit
5831af3fe2
1 changed files with 1 additions and 1 deletions
2
file.c
2
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;
|
||||
|
|
Loading…
Reference in a new issue