From: Thierry FOURNIER Date: Wed, 26 Feb 2014 17:30:13 +0000 (+0100) Subject: BUG/MEDIUM: map: The map parser includes blank lines. X-Git-Tag: v1.5-dev23~148 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=338a031e29e4ac514c5bcf0caf4e16ce8afff5df;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: map: The map parser includes blank lines. The parser check the end line comparing to the null character. In fact, the end of line can be also '\r' or '\n'. The effect is that empty lines are loaded and indexed in maps. The bug was introduced by commit d5f624dd ("MEDIUM: sample: add the "map" converter") in 1.5-dev20. No backport is needed. --- diff --git a/src/map.c b/src/map.c index 28908c534f..c3a13a7cb8 100644 --- a/src/map.c +++ b/src/map.c @@ -248,7 +248,7 @@ static int map_read_entries_from_file(const char *filename, c++; /* empty lines are ignored too */ - if (*c == '\0') + if (*c == '\0' || *c == '\r' || *c == '\n') continue; /* look for the end of the key */