]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
mem: Use correct len with strlcpy
authorJeff Lucovsky <jeff@lucovsky.org>
Sat, 12 Oct 2019 14:35:53 +0000 (10:35 -0400)
committerVictor Julien <victor@inliniac.net>
Sat, 12 Oct 2019 16:17:39 +0000 (18:17 +0200)
src/util-mem.h

index 1a80480ba21c2318bef2827ed71c469457f23ab4..52ed35d51889adadbf04960fa5c265c490624278 100644 (file)
@@ -172,7 +172,7 @@ SC_ATOMIC_EXTERN(unsigned int, engine_stage);
             exit(EXIT_FAILURE); \
         } \
     } else { \
-        strlcpy(ptrmem, (a), _len); \
+        strlcpy(ptrmem, (a), _scstrndup_len); \
         *(ptrmem + _len) = '\0'; \
     } \
     \
@@ -296,7 +296,7 @@ SC_ATOMIC_EXTERN(unsigned int, engine_stage);
             exit(EXIT_FAILURE); \
         } \
     } else { \
-        strlcpy(ptrmem, (a), _len); \
+        strlcpy(ptrmem, (a), _scstrndup_len); \
         *(ptrmem + _len) = '\0'; \
     } \
     (void*)ptrmem; \