From 0018d8b4e4e9e8524bf8ed2ac5b61ef987b852a9 Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Mon, 13 Sep 2021 16:57:19 +0200 Subject: Enforce sizes of package serialization structures --- zenhttp/httpshared.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'zenhttp/httpshared.h') diff --git a/zenhttp/httpshared.h b/zenhttp/httpshared.h index dbbebb348..fbf35076b 100644 --- a/zenhttp/httpshared.h +++ b/zenhttp/httpshared.h @@ -17,6 +17,8 @@ struct CbPackageHeader uint32_t Reserved2; }; +static_assert(sizeof(CbPackageHeader) == 16); + static constinit uint32_t kCbPkgMagic = 0xaa77aacc; struct CbAttachmentEntry @@ -26,6 +28,8 @@ struct CbAttachmentEntry IoHash AttachmentHash; }; +static_assert(sizeof(CbAttachmentEntry) == 32); + std::vector FormatPackageMessage(const CbPackage& Data); CbPackage ParsePackageMessage(IoBuffer Payload); -- cgit v1.2.3