mirror of
https://salsa.debian.org/ha-team/libqb
synced 2025-12-29 17:07:04 +00:00
LOG: Gracefully fail when the caller exceeds QB_LOG_MAX_LEN
This commit is contained in:
parent
9b0bb4e80e
commit
bb2e307241
@ -96,6 +96,13 @@ _blackbox_vlogger(int32_t target,
|
||||
|
||||
/* log message */
|
||||
msg_len = qb_vsprintf_serialize(chunk, cs->format, ap);
|
||||
if(msg_len > QB_LOG_MAX_LEN) {
|
||||
chunk = msg_len_pt + sizeof(uint32_t); /* Reset */
|
||||
|
||||
msg_len = qb_vsprintf_serialize(chunk, "Log message too long to be stored in the blackbox. Maximum is QB_LOG_MAX_LEN" , ap);
|
||||
actual_size += msg_len;
|
||||
}
|
||||
|
||||
actual_size += msg_len;
|
||||
|
||||
/* now that we know the length, write it
|
||||
|
||||
Loading…
Reference in New Issue
Block a user