Fix: test uses sizeof() on the wrong operand of strncpy
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 9 May 2018 01:22:36 +0000 (21:22 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 9 May 2018 19:11:03 +0000 (15:11 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
tests/unit/test_session.c

index 03e6b91611ad0732fa82faf0c386c252cf0ca4c5..cfbb52d048dd00820e6817a24dbe221a5a165716 100644 (file)
@@ -157,7 +157,7 @@ static int destroy_one_session(struct ltt_session *session)
        int ret;
        char session_name[NAME_MAX];
 
-       strncpy(session_name, session->name, sizeof(session->name));
+       strncpy(session_name, session->name, sizeof(session_name));
        session_name[sizeof(session_name) - 1] = '\0';
 
        ret = session_destroy(session);
This page took 0.025868 seconds and 4 git commands to generate.