Message ID | 1419457447-11360-1-git-send-email-mike.holmes@linaro.org |
---|---|
State | Accepted |
Headers | show |
On 2014-12-24 16:44, Mike Holmes wrote: > CID 85015: Copy into fixed size buffer (STRING_OVERFLOW) > > Signed-off-by: Mike Holmes <mike.holmes@linaro.org> Reviewed-by: Anders Roxell <anders.roxell@linaro.org> > --- > test/validation/odp_system.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/test/validation/odp_system.c b/test/validation/odp_system.c > index 2afd4a7..b5742c4 100644 > --- a/test/validation/odp_system.c > +++ b/test/validation/odp_system.c > @@ -28,7 +28,7 @@ static void test_odp_sys_cpu_model_str(void) > { > char model[128]; > > - strcpy(model, odp_sys_cpu_model_str()); > + snprintf(model, 128, "%s", odp_sys_cpu_model_str()); > CU_ASSERT(strlen(model) > 0); > CU_ASSERT(strlen(model) < 127); > } > -- > 2.1.0 > > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org > http://lists.linaro.org/mailman/listinfo/lng-odp
Applied On 5 January 2015 at 18:50, Anders Roxell <anders.roxell@linaro.org> wrote: > On 2014-12-24 16:44, Mike Holmes wrote: > > CID 85015: Copy into fixed size buffer (STRING_OVERFLOW) > > > > Signed-off-by: Mike Holmes <mike.holmes@linaro.org> > > Reviewed-by: Anders Roxell <anders.roxell@linaro.org> > > > --- > > test/validation/odp_system.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/test/validation/odp_system.c b/test/validation/odp_system.c > > index 2afd4a7..b5742c4 100644 > > --- a/test/validation/odp_system.c > > +++ b/test/validation/odp_system.c > > @@ -28,7 +28,7 @@ static void test_odp_sys_cpu_model_str(void) > > { > > char model[128]; > > > > - strcpy(model, odp_sys_cpu_model_str()); > > + snprintf(model, 128, "%s", odp_sys_cpu_model_str()); > > CU_ASSERT(strlen(model) > 0); > > CU_ASSERT(strlen(model) < 127); > > } > > -- > > 2.1.0 > > > > > > _______________________________________________ > > lng-odp mailing list > > lng-odp@lists.linaro.org > > http://lists.linaro.org/mailman/listinfo/lng-odp >
diff --git a/test/validation/odp_system.c b/test/validation/odp_system.c index 2afd4a7..b5742c4 100644 --- a/test/validation/odp_system.c +++ b/test/validation/odp_system.c @@ -28,7 +28,7 @@ static void test_odp_sys_cpu_model_str(void) { char model[128]; - strcpy(model, odp_sys_cpu_model_str()); + snprintf(model, 128, "%s", odp_sys_cpu_model_str()); CU_ASSERT(strlen(model) > 0); CU_ASSERT(strlen(model) < 127); }
CID 85015: Copy into fixed size buffer (STRING_OVERFLOW) Signed-off-by: Mike Holmes <mike.holmes@linaro.org> --- test/validation/odp_system.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)