From 3f41560f610971cd6aaa24fe240949d938109d26 Mon Sep 17 00:00:00 2001 From: William Lallemand Date: Tue, 12 May 2015 14:01:09 +0200 Subject: [PATCH] BUG/MEDIUM: cfgparse: incorrect memmove in quotes management The size of the memmove was incorrect (one byte too far) in the quotes parser and can lead to segfault during configuration parsing. --- src/cfgparse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cfgparse.c b/src/cfgparse.c index 39ba14515..8469dfd24 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -6331,7 +6331,7 @@ int readcfgfile(const char *file) dquote = 0; else dquote = 1; - memmove(line, line + 1, end - (line + 1)); + memmove(line, line + 1, end - line); end--; } else if (*line == '\'' && !dquote) { /* single quote outside double quotes */ @@ -6339,7 +6339,7 @@ int readcfgfile(const char *file) squote = 0; else squote = 1; - memmove(line, line + 1, end - (line + 1)); + memmove(line, line + 1, end - line); end--; } else if (*line == '\\' && !squote) { -- 2.47.3