]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
catalog: reject entries where the language is too short early
authorEvgeny Vereshchagin <evvers@ya.ru>
Thu, 29 Nov 2018 02:05:20 +0000 (03:05 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 29 Nov 2018 04:41:40 +0000 (13:41 +0900)
Closes https://oss-fuzz.com/testcase-detail/5674475278827520

src/journal/catalog.c
test/fuzz/fuzz-catalog/clusterfuzz-testcase-minimized-fuzz-catalog-5674475278827520 [new file with mode: 0644]

index 63d27337b53bb0dc2e4cdaa171c05f95b59df2da..0f18d31addf26afab754fd14bb42ec167fcd1da3 100644 (file)
@@ -217,7 +217,7 @@ static int catalog_entry_lang(const char* filename, int line,
         size_t c;
 
         c = strlen(t);
-        if (c == 0)
+        if (c < 2)
                 return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
                                        "[%s:%u] Language too short.",
                                        filename, line);
diff --git a/test/fuzz/fuzz-catalog/clusterfuzz-testcase-minimized-fuzz-catalog-5674475278827520 b/test/fuzz/fuzz-catalog/clusterfuzz-testcase-minimized-fuzz-catalog-5674475278827520
new file mode 100644 (file)
index 0000000..2594f49
--- /dev/null
@@ -0,0 +1,2 @@
+-- ae2f7b866b0347b9af31fe1c80b127c0 ΓΏ
\ No newline at end of file