Skip to content

Commit 9d3a53d

Browse files
authored
added std::max to avoid buffer overflow in printing (ROCm#25)
1 parent a8c920c commit 9d3a53d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/common.cu‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ testResult_t TimeTest(struct threadArgs* args, ncclDataType_t type, const char*
652652
setupArgs(size, type, args);
653653
char rootName[100];
654654
sprintf(rootName, "%6i", root);
655-
PRINT("%12li %12li %8s %6s %6s", (size_t)max(args->sendBytes, args->expectedBytes), args->nbytes / wordSize(type), typeName, opName, rootName);
655+
PRINT("%12li %12li %8s %6s %6s", std::max(args->sendBytes, args->expectedBytes), args->nbytes / wordSize(type), typeName, opName, rootName);
656656
TESTCHECK(BenchTime(args, type, op, root, 0));
657657
usleep(delay_inout_place);
658658
TESTCHECK(BenchTime(args, type, op, root, 1));

0 commit comments

Comments
 (0)