require -DENABLE_DLSYM=1 to use dlsym() (#13958)
Costa Tsaousis committed
Nov 8, 2022 at 14:44 UTC
275dd9c4fb79961c697254c8cfa933cdde3ee0ad
1 file changed
+2
-3
libnetdata/libnetdata.c
+2
-3
@@ -34,7 +34,7 @@ const char *program_version = VERSION;
34
#warning NETDATA_TRACE_ALLOCATIONS ENABLED
35
#include "Judy.h"
36
37
-#ifdef HAVE_DLSYM
37
+#if defined(HAVE_DLSYM) && defined(ENABLE_DLSYM)
38
#include <dlfcn.h>
39
40
typedef void (*libc_function_t)(void);
@@ -136,7 +136,6 @@ static void *(*libc_malloc)(size_t) = malloc;
136
static void *(*libc_calloc)(size_t, size_t) = calloc;
137
static void *(*libc_realloc)(void *, size_t) = realloc;
138
static void (*libc_free)(void *) = free;
139
-static char *(*libc_strdup)(const char *) = strdup;
139
140
#ifdef HAVE_MALLOC_USABLE_SIZE
141
static size_t (*libc_malloc_usable_size)(void *) = malloc_usable_size;
@@ -312,7 +311,7 @@ char *strdupz_int(const char *s, const char *file, const char *function, size_t
311
t->padding[i] = 0xFF;
312
#endif
313
315
- strcpy((char *)&t->data, s);
314
+ memcpy(&t->data, s, size);
315
return (char *)&t->data;
316
}
317