Skip to content

Commit

Permalink
theoretical problem found by snyke
Browse files Browse the repository at this point in the history
  • Loading branch information
folkertvanheusden committed Oct 14, 2024
1 parent f5599a4 commit f529663
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ namespace logging {
sl_nr += 2; // critical

int offset = snprintf(err_log_buf, sizeof err_log_buf, "<%d>%s|%s] ", sl_nr, component, context.c_str());
if (offset == -1)
offset = 0; // snprintf failed, proceeed without component etc

va_list ap;
va_start(ap, fmt);
Expand Down

0 comments on commit f529663

Please sign in to comment.