From 6438a9cf29a6a0da1e7f83594f51392389409fdc Mon Sep 17 00:00:00 2001 From: wiire-a Date: Sun, 31 Dec 2017 11:37:59 +0100 Subject: [PATCH] Fixed struct ie_vtag misalignment access due to not packed struct This struct must be packed (no padding). Found with GCC's -fsanitize=undefined. --- src/wps.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wps.h b/src/wps.h index f0c5213..95e627f 100644 --- a/src/wps.h +++ b/src/wps.h @@ -56,7 +56,7 @@ struct ie_vtag { #define WPS_TAG_NET_KEY_IDX_LEN 1 #define WPS_TAG_KEYWRAP_AUTH_LEN 8 uint8_t data[]; -}; +} __attribute__((packed)); #define VTAG_SIZE (sizeof(struct ie_vtag)) struct ie_vtag *find_vtag(void *vtagp, int vtagl, void *vidp, int vlen)