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:
zatwierdzone przez
GitHub
rodzic
2a216ecbc1
commit
f2f7f03d61
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user