diff options
| author | Glen Barber <gjb@FreeBSD.org> | 2026-09-03 07:51:28 +0000 |
|---|---|---|
| committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2026-09-03 07:58:54 +0000 |
| commit | 8646d65b45339642d4aab1de35a2bc79fc45f09e (patch) | |
| tree | 640cd0d2dacdf918b77340ab0b3f5f0fd843cf19 /lib/Serialization/ModuleFileExtension.cpp | |
| parent | 37aec55d0a7165960f686e5277f030ab3d44cf45 (diff) | |
hastd: Fix crash on empty message
A HAST message can be empty, in which case ebuf_add_tail() does nothing
and ebuf_data() returns NULL because the size of the ebuf is zero, but
hast_proto_recv_hdr() asserts that the return value is not NULL,
resulting in an immediate crash if hastctl or hastd receive an empty
message. This is trivially reproducable by running `hastctl status` or
`hastctl role init` (as the rc script does prior to stopping hastd).
To avoid this, don't try to grow the ebuf or receive additional data
if the header size is zero.
PR: 298085
MFC after: 3 days
Reviewed by: kevans, gjb
Differential Revision: https://reviews.freebsd.org/D59306
Diffstat (limited to 'lib/Serialization/ModuleFileExtension.cpp')
0 files changed, 0 insertions, 0 deletions
