This is an automated email from the ASF dual-hosted git repository. apupier pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit 02f8aafadf39767e656159314d078bf043b46f54 Author: smjain <[email protected]> AuthorDate: Tue Sep 29 13:21:43 2026 +0530 CAMEL-25127: camel-syslog - pin down the parsing of an unterminated PARAM-VALUE Co-Authored-By: Claude Opus 5.5 <[email protected]> --- .../camel/component/syslog/SyslogRfc5424ParseTest.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/components/camel-syslog/src/test/java/org/apache/camel/component/syslog/SyslogRfc5424ParseTest.java b/components/camel-syslog/src/test/java/org/apache/camel/component/syslog/SyslogRfc5424ParseTest.java index 251b73b2e0fa..e786a7cf4aca 100644 --- a/components/camel-syslog/src/test/java/org/apache/camel/component/syslog/SyslogRfc5424ParseTest.java +++ b/components/camel-syslog/src/test/java/org/apache/camel/component/syslog/SyslogRfc5424ParseTest.java @@ -68,6 +68,18 @@ public class SyslogRfc5424ParseTest extends CamelTestSupport { assertEquals("hello", message.getLogMessage()); } + @Test + public void testUnterminatedParamValue() { + // invalid input: the PARAM-VALUE is never closed, so the rest of the message is read as structured data and + // MSG is empty (before, the element was closed at the ']' inside the quotes) + String rest = "[exampleSDID@32473 note=\"x] hello"; + + Rfc5424SyslogMessage message = parse(HEADER + rest); + + assertEquals(rest, message.getStructuredData()); + assertEquals("", message.getLogMessage()); + } + @Test public void testEscapedQuoteAndBackslashInParamValue() { String sd = "[exampleSDID@32473 quote=\"say \\\"x\\] y\\\"\" path=\"c:\\\\\" note=\"b\\] c\"][other@32473 n=\"2\"]";
