From f53f1927dc641dc78a5fca0990d90e3ab9011ce8 Mon Sep 17 00:00:00 2001 From: linderd <19273958+linderd@users.noreply.github.com> Date: Sun, 3 Dec 2023 16:38:02 +0100 Subject: [PATCH] fix msan-findings in libfuzzer and ikev2_pld_notify() --- iked/ikev2_pld.c | 4 ++-- regress/parser-libfuzzer/common.c | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/iked/ikev2_pld.c b/iked/ikev2_pld.c index 05ed27a0..136ed932 100644 --- a/iked/ikev2_pld.c +++ b/iked/ikev2_pld.c @@ -1049,8 +1049,8 @@ ikev2_pld_notify(struct iked *env, struct ikev2_payload *pld, struct ikev2_notify n; const struct iked_sa *sa = msg->msg_sa; uint8_t *buf, md[SHA_DIGEST_LENGTH]; - uint32_t spi32; - uint64_t spi64; + uint32_t spi32 = 0; + uint64_t spi64 = 0; struct iked_spi *rekey; uint16_t type; uint16_t signature_hash; diff --git a/regress/parser-libfuzzer/common.c b/regress/parser-libfuzzer/common.c index 7871d208..5d17e14f 100644 --- a/regress/parser-libfuzzer/common.c +++ b/regress/parser-libfuzzer/common.c @@ -162,6 +162,7 @@ ssize_t ikev2_nat_detection(struct iked *env, struct iked_message *msg, void *ptr, size_t len, u_int type, int frompeer) { + bzero(ptr, len) return (0); }