Fix buffer overrun (#655)

Assigning a null terminator at
the end of the string wrote
past the end of the allocated
buffer. This patch corrects that.

Signed-off-by: Ashutosh Mishra <ashutosh.mishra@amd.com>
This commit is contained in:
Ashutosh Mishra
2025-08-25 09:41:25 +05:30
zatwierdzone przez GitHub
rodzic 2a216ecbc1
commit f2f7f03d61
+1 -3
Wyświetl plik
@@ -48,9 +48,7 @@ static VerErrors getBuildInfo( char* InfoString, int len ) {
NULL_CHECK(InfoString);
#if defined(ROCM_BUILD_INFO)
strcpy(InfoString,ROCM_BUILD_INFO);
InfoString[len]='\0';
snprintf(InfoString, len, "%s", ROCM_BUILD_INFO);
#else
return VerValuesNotDefined;
#endif //end defination checker