Skip to content

Segmentation fault in format json with a space before the = 5065#5080

Merged
HofiOne merged 3 commits intosyslog-ng:masterfrom
HofiOne:Segmentation-fault-in-format-json-with-a-space-before-the-=-5065
Aug 30, 2024
Merged

Segmentation fault in format json with a space before the = 5065#5080
HofiOne merged 3 commits intosyslog-ng:masterfrom
HofiOne:Segmentation-fault-in-format-json-with-a-space-before-the-=-5065

Conversation

@HofiOne
Copy link
Collaborator

@HofiOne HofiOne commented Aug 29, 2024

Spaces around = in $(format-json) template function could cause a crash.
The fix of the issue also introduced an enhancement, from now on spaces are allowed around the = operator, so the following $(format-json) template function calls are all valid:

$(format-json foo =alma)
$(format-json foo= alma)
$(format-json foo = alma)
$(format-json foo=\" alma \")
$(format-json foo= \" alma \")
$(format-json foo1= alma foo2 =korte foo3 = szilva foo4 = \" meggy \" foo5=\"\")

Please note the usage of the escaped strings like \" meggy \", and the (escaped and) quoted form that used for an empty value \"\", the latter is a breaking change as earlier an expression like key= led to a json key-value pair with an empty value {"key":""} that will not work anymore.

Fixes: #5065

Signed-off-by: Hofi [email protected]

@HofiOne HofiOne marked this pull request as draft August 29, 2024 12:32
@HofiOne HofiOne force-pushed the Segmentation-fault-in-format-json-with-a-space-before-the-=-5065 branch from f30f755 to 6e070ea Compare August 29, 2024 12:42
@kira-syslogng
Copy link
Contributor

Build FAILURE

@HofiOne HofiOne force-pushed the Segmentation-fault-in-format-json-with-a-space-before-the-=-5065 branch 3 times, most recently from 24aa432 to 5f9dc12 Compare August 29, 2024 13:11
HofiOne added a commit to HofiOne/syslog-ng that referenced this pull request Aug 29, 2024
@HofiOne HofiOne marked this pull request as ready for review August 29, 2024 14:31
@HofiOne HofiOne force-pushed the Segmentation-fault-in-format-json-with-a-space-before-the-=-5065 branch from aa3846c to b64d040 Compare August 30, 2024 08:08
@HofiOne HofiOne merged commit 159f055 into syslog-ng:master Aug 30, 2024
@HofiOne HofiOne deleted the Segmentation-fault-in-format-json-with-a-space-before-the-=-5065 branch August 30, 2024 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Segmentation fault in format-json with a space before the =

3 participants