summaryrefslogtreecommitdiff
path: root/tests/unit/core/test-string.cpp
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2017-04-22 15:15:54 +0200
committerSébastien Helleu <flashcode@flashtux.org>2017-04-22 15:15:54 +0200
commit94355e2e38a892e41d04f8405d9bd9bfed71e1f4 (patch)
tree96e5934462e4cc7ab7d6a43608139b64e0fff712 /tests/unit/core/test-string.cpp
parent572678100b817878c78202b32819ea4597542e33 (diff)
downloadweechat-94355e2e38a892e41d04f8405d9bd9bfed71e1f4.zip
core: ensure length is not negative in function string_strndup
Diffstat (limited to 'tests/unit/core/test-string.cpp')
-rw-r--r--tests/unit/core/test-string.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/unit/core/test-string.cpp b/tests/unit/core/test-string.cpp
index 19e7c89c4..a7bc807de 100644
--- a/tests/unit/core/test-string.cpp
+++ b/tests/unit/core/test-string.cpp
@@ -123,6 +123,8 @@ TEST(String, Duplicate)
POINTERS_EQUAL(NULL, string_strndup (NULL, 0));
+ POINTERS_EQUAL(NULL, string_strndup (str_test, -1));
+
str = string_strndup (str_test, 0);
CHECK(str);
CHECK(str != str_test);