]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Use strlcpy() to copy strings, not memcpy()
authorHarlan Stenn <stenn@ntp.org>
Wed, 12 Jul 2017 10:40:04 +0000 (06:40 -0400)
committerHarlan Stenn <stenn@ntp.org>
Wed, 12 Jul 2017 10:40:04 +0000 (06:40 -0400)
bk: 5965fc84KrdHrKzumgttIu9NTrzndQ

ChangeLog
sntp/tests/packetProcessing.c

index 8486ad12714259f25b13cf2b71f8446515e37777..2784314144618eab2d4717a06994a54b250c3240 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 ---
 
 * [Bug 3358] Spurious KoD log messages in .INIT. phase.  HStenn.
+* Use strlcpy() to copy strings, not memcpy().  HStenn.
 
 ---
 (4.2.8p10) 2017/03/21 Released by Harlan Stenn <stenn@ntp.org>
index 660b5b6e20f15916fbb6a77046d99899a7c609c6..8a8427af5fe76b6467a132c7e3ef6c9c56c6162c 100644 (file)
@@ -76,7 +76,7 @@ PrepareAuthenticationTest(
        key_ptr->next = NULL;
        key_ptr->key_id = key_id;
        key_ptr->key_len = key_len;
-       memcpy(key_ptr->type, "MD5", 3);
+       strlcpy(key_ptr->type, "MD5", sizeof key_ptr->type);
 
        TEST_ASSERT_TRUE(key_len < sizeof(key_ptr->key_seq));