From 9d3a53dfa3af22bfdc86b1ed37867f3cdc2762b1 Mon Sep 17 00:00:00 2001 From: akolliasAMD <99202231+akolliasAMD@users.noreply.github.com> Date: Tue, 1 Nov 2022 11:34:55 -0600 Subject: [PATCH] added std::max to avoid buffer overflow in printing (#25) --- src/common.cu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common.cu b/src/common.cu index ce7f193ae1..bdac4b6b11 100644 --- a/src/common.cu +++ b/src/common.cu @@ -652,7 +652,7 @@ testResult_t TimeTest(struct threadArgs* args, ncclDataType_t type, const char* setupArgs(size, type, args); char rootName[100]; sprintf(rootName, "%6i", root); - PRINT("%12li %12li %8s %6s %6s", (size_t)max(args->sendBytes, args->expectedBytes), args->nbytes / wordSize(type), typeName, opName, rootName); + PRINT("%12li %12li %8s %6s %6s", std::max(args->sendBytes, args->expectedBytes), args->nbytes / wordSize(type), typeName, opName, rootName); TESTCHECK(BenchTime(args, type, op, root, 0)); usleep(delay_inout_place); TESTCHECK(BenchTime(args, type, op, root, 1));