Skip to content

Commit

Permalink
Merge pull request #5163 from syslog-ng/fix-cfg-nullptr-crash
Browse files Browse the repository at this point in the history
Fixed crash on startup caused by missing cfg options in certain scl drivers
  • Loading branch information
therandomstring authored Nov 4, 2024
2 parents 9ca90a2 + 0d64f2f commit 6113797
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
13 changes: 8 additions & 5 deletions lib/cfg-block-generator.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,15 @@ _report_generator_args(gpointer key, gpointer value, gpointer user_data)
{
GString *result = (GString *) user_data;
g_string_append_printf(result, "## %s=", (gchar *) key);
for (const gchar *c = (const gchar *) value; *c; c++)
if (value != NULL)
{
if (*c == '\n' && *(c + 1))
g_string_append(result, "\n## ");
else
g_string_append_c(result, *c);
for (const gchar *c = (const gchar *) value; *c; c++)
{
if (*c == '\n' && *(c + 1))
g_string_append(result, "\n## ");
else
g_string_append_c(result, *c);
}
}

g_string_append_c(result, '\n');
Expand Down
1 change: 1 addition & 0 deletions news/bugfix-5163.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cfg: Fixed syslog-ng crashing on startup when using certain scl drivers without some options defined.

0 comments on commit 6113797

Please sign in to comment.