From 909179eaaf363deb6bd102da51fd5c5465aeb72d Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Wed, 27 Mar 2024 09:09:47 +0000 Subject: [PATCH] ASAN fixes --- config.mk | 4 +++- test/lib/cpp/08-ssl-connect-cert-auth-enc.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/config.mk b/config.mk index 340274bf..80feed43 100644 --- a/config.mk +++ b/config.mk @@ -232,8 +232,10 @@ endif ifeq ($(WITH_ASAN),yes) CC:=clang + CXX:=clang++ LOCAL_CFLAGS+=-fsanitize=address -fno-omit-frame-pointer - LOCAL_LDFLAGS+=-fsanitize=address -fno-omit-frame-pointer + LOCAL_CXXFLAGS+=-fsanitize=address -fno-omit-frame-pointer + LOCAL_LDFLAGS+=-fsanitize=address -fno-omit-frame-pointer -static-libsan endif ifeq ($(WITH_LTO),yes) diff --git a/test/lib/cpp/08-ssl-connect-cert-auth-enc.cpp b/test/lib/cpp/08-ssl-connect-cert-auth-enc.cpp index 9cab5b33..0d7aef61 100644 --- a/test/lib/cpp/08-ssl-connect-cert-auth-enc.cpp +++ b/test/lib/cpp/08-ssl-connect-cert-auth-enc.cpp @@ -10,7 +10,7 @@ static int password_callback(char* buf, int size, int rwflag, void* userdata) (void)rwflag; (void)userdata; - strncpy(buf, "password", size); + strncpy(buf, "password", (size_t )size); buf[size-1] = '\0'; return (int)strlen(buf);