From 601d5ef9db58d9017b33a305ddac16f207c14ce1 Mon Sep 17 00:00:00 2001 From: Vincent Thiberville Date: Wed, 28 Jun 2023 12:47:24 +0200 Subject: [PATCH] fix: ensure all notebook allocations are 8-byte aligned --- libyara/notebook.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libyara/notebook.c b/libyara/notebook.c index cc173fd1a9..3680df029b 100644 --- a/libyara/notebook.c +++ b/libyara/notebook.c @@ -64,7 +64,10 @@ struct YR_NOTEBOOK_PAGE // Pointer to next page. YR_NOTEBOOK_PAGE* next; // Page's data. - uint8_t data[0]; + // + // This field must be 8-byte aligned to guarantee that all notebooks + // allocations are 8-byte aligned. + YR_ALIGN(8) uint8_t data[0]; }; ////////////////////////////////////////////////////////////////////////////////