mirror of
https://github.com/eclipse-mosquitto/mosquitto.git
synced 2026-09-22 16:15:05 +08:00
ASAN fixes
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user