]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
varlink-idl: allow unbalanced quote and trailing backslash in comment
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 19 Jun 2024 06:17:26 +0000 (15:17 +0900)
committerLennart Poettering <lennart@poettering.net>
Wed, 19 Jun 2024 12:12:20 +0000 (14:12 +0200)
Fixes #33381.
Fixes OSS-FUZZ#69730.
Follow-up for fbb69c0306d434153ca85b227c7d42b9c92872e4.

src/shared/varlink-idl.c
test/fuzz/fuzz-varlink-idl/oss-fuzz-69730 [new file with mode: 0644]

index 7e24ff7cc0d7f3ab1b68bfc5486283fa8323ef8b..78d719a4961c284d297ed1a8800f33fa371a7855 100644 (file)
@@ -48,7 +48,7 @@ static int varlink_idl_format_comment(
         }
 
         _cleanup_strv_free_ char **l = NULL;
-        r = strv_split_full(&l, text, NEWLINE, 0);
+        r = strv_split_full(&l, text, NEWLINE, EXTRACT_RELAX);
         if (r < 0)
                 return log_error_errno(r, "Failed to split comment string: %m");
 
diff --git a/test/fuzz/fuzz-varlink-idl/oss-fuzz-69730 b/test/fuzz/fuzz-varlink-idl/oss-fuzz-69730
new file mode 100644 (file)
index 0000000..395638a
--- /dev/null
@@ -0,0 +1,2 @@
+#\
+interface.
\ No newline at end of file