From 76bd9d36744b89e791423ba16f9db323816888e4 Mon Sep 17 00:00:00 2001 From: niranjanjoshi121 <43807392+niranjanjoshi121@users.noreply.github.com> Date: Tue, 20 Sep 2022 21:23:34 +0530 Subject: [PATCH] Fix memory oob problem in test half (#1489) Allocate memory for argc arguments instead of argc - 1. --- test_conformance/half/main.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test_conformance/half/main.cpp b/test_conformance/half/main.cpp index 6600cc58..104f4616 100644 --- a/test_conformance/half/main.cpp +++ b/test_conformance/half/main.cpp @@ -131,8 +131,7 @@ exit: static int ParseArgs( int argc, const char **argv ) { int i; - argList = (const char **)calloc( argc - 1, sizeof( char*) ); - + argList = (const char **)calloc(argc, sizeof(char *)); if( NULL == argList ) { vlog_error( "Failed to allocate memory for argList.\n" );