Skip to content

Commit c0f9cb3

Browse files
committed
if auparse_first_record fails, remove the newline that got added
1 parent 6c76940 commit c0f9cb3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/auditd-event.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,8 @@ static const char *format_enrich(const struct audit_reply *rep)
468468

469469
// Loop over all fields while possible to add field
470470
rc = auparse_first_record(au);
471+
if (rc != 1)
472+
format_buf[mlen] = 0; //remove newline on failure
471473
rtype = auparse_get_type(au);
472474
switch (rtype)
473475
{ // Flush before adding to pickup new associations

0 commit comments

Comments
 (0)