From 1cc9c2177d5fcd92ea936c0ed50cfb712bcf2b30 Mon Sep 17 00:00:00 2001 From: Georg Reinke Date: Fri, 7 Jul 2017 11:27:03 +0200 Subject: [PATCH] file: prevent stack corruption when reading first sample --- lib/nodes/file.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/nodes/file.c b/lib/nodes/file.c index 617656f9e..e6e01cf25 100644 --- a/lib/nodes/file.c +++ b/lib/nodes/file.c @@ -267,6 +267,7 @@ int file_start(struct node *n) /* Get timestamp of first line */ if (f->read_epoch_mode != FILE_EPOCH_ORIGINAL) { struct sample s; + s.capacity = 0; ret = sample_io_villas_fscan(f->read.handle->file, &s, NULL); if (ret < 0) @@ -402,4 +403,4 @@ static struct plugin p = { }; REGISTER_PLUGIN(&p) -LIST_INIT_STATIC(&p.node.instances) \ No newline at end of file +LIST_INIT_STATIC(&p.node.instances)