← Commit list

b143b3f1d

Denys Vlasenko
Denys Vlasenko
2025-11-25
SUCCESS Duration: 162s

Subject

tls: better error message when TLS record is truncated

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0
gcc -Wp,-MD,applets/.applet_tables.d -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer       -o applets/applet_tables applets/applet_tables.c

Build Log

(log yok)

Commit Diff GitHub →

networking/tls.c+4 -1
@@ -971,7 +971,10 @@ static int tls_xread_record(tls_state_t *tls, const char *expected)
tls->buffered_size = 0;
goto end;
}
- bb_perror_msg_and_die("short read, have only %d", total);
+ /* Used to say "wget: short read, have only 186" here. More informative: */
+ if (total < RECHDR_LEN)
+ bb_perror_msg_and_die("%s header: got %d bytes", "truncated TLS record", total);
+ bb_perror_msg_and_die("%s: expected %d, got %d bytes", "truncated TLS record", target, total);
}
dump_raw_in("<< %s\n", tls->inbuf + total, sz);
total += sz;