From 99c34961b9d48ef25113e7d8b1827cdf88cb0a5d Mon Sep 17 00:00:00 2001 From: wise86Android Date: Sun, 18 Sep 2016 21:37:31 +0200 Subject: [PATCH] Covery: 152484 Buffer not null terminated --- test/unit/utBlenderIntermediate.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/unit/utBlenderIntermediate.cpp b/test/unit/utBlenderIntermediate.cpp index 0bf40936b..eea30e202 100644 --- a/test/unit/utBlenderIntermediate.cpp +++ b/test/unit/utBlenderIntermediate.cpp @@ -48,10 +48,13 @@ class BlenderIntermediateTest : public ::testing::Test { // empty }; +#define NAME_1 "name1" +#define NAME_2 "name2" + TEST_F( BlenderIntermediateTest,ConversionData_ObjectCompareTest ) { Object obj1, obj2; - strncpy( obj1.id.name, "name1", 5 ); - strncpy( obj2.id.name, "name2", 5 ); + strncpy( obj1.id.name, NAME_1, sizeof(NAME_1) ); + strncpy( obj2.id.name, NAME_2, sizeof(NAME_2) ); Blender::ObjectCompare cmp_false; bool res( cmp_false( &obj1, &obj2 ) ); EXPECT_FALSE( res );