From: Stephan Bosch Date: Fri, 19 Dec 2025 03:02:14 +0000 (+0100) Subject: lib: test-unicode-break - Fix potential crash on empty lines X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fec739bca688d14cd5188a345fcc9bef48d9ffd9;p=thirdparty%2Fdovecot%2Fcore.git lib: test-unicode-break - Fix potential crash on empty lines --- diff --git a/src/lib/test-unicode-break.c b/src/lib/test-unicode-break.c index cd0428d4de..867d63ef7a 100644 --- a/src/lib/test-unicode-break.c +++ b/src/lib/test-unicode-break.c @@ -76,8 +76,10 @@ test_ucd_file(const char *file, line_num++; /* remove any trailing whitespace and comment */ + if (*line == '\0') + continue; char *end = strchr(line, '#'); - if (end == NULL && *line != '\0') + if (end == NULL) end = &line[strlen(line) - 1]; while ((end - 1) >= line && (end[-1] == '\t' || end[-1] == ' ')) end--;