Skip to content

Commit

Permalink
eve/alert: break out of payload logging callback if buffer is full
Browse files Browse the repository at this point in the history
(cherry picked from commit 926c6e3)
  • Loading branch information
victorjulien authored and jlucovsky committed Aug 15, 2024
1 parent de1ec06 commit d8c5a7e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/output-json-alert.c
Original file line number Diff line number Diff line change
Expand Up @@ -722,9 +722,12 @@ static int AlertJsonStreamDataCallback(
cbd->payload, "[%" PRIu64 " bytes missing]", input_offset - cbd->last_re);
}

MemBufferWriteRaw(cbd->payload, input, input_len);
int done = 0;
uint32_t written = MemBufferWriteRaw(cbd->payload, input, input_len);
if (written < input_len)
done = 1;
cbd->last_re = input_offset + input_len;
return 0;
return done;
}

/** \internal
Expand Down

0 comments on commit d8c5a7e

Please sign in to comment.