Skip to content

Commit c488119

Browse files
committed
iolog_read_timing_record: only log the first 128 bytes of bad lines
If the timing line is invalid or corrupt there's no reason to log the entire thing, up to LINE_MAX. The first 128 bytes should be sufficient to debug the problem.
1 parent 646ec6e commit c488119

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/iolog/iolog_timing.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,8 @@ iolog_read_timing_record(struct iolog_file *iol, struct timing_closure *timing)
281281

282282
debug_return_int(0);
283283
invalid:
284+
/* Truncate invalid timing file line at 128 bytes. */
285+
line[128] = '\0';
284286
sudo_warnx(U_("invalid timing file line: %s"), line);
285287
debug_return_int(-1);
286288
}

0 commit comments

Comments
 (0)