fix strncpy bound error (#4331)

This commit is contained in:
John Zupin 2021-06-29 08:07:13 -06:00 committed by GitHub
parent b8587c984a
commit eeff9af1e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,7 +37,7 @@ spv_diagnostic spvDiagnosticCreate(const spv_position position,
diagnostic->position = *position;
diagnostic->isTextSource = false;
memset(diagnostic->error, 0, length);
strncpy(diagnostic->error, message, length);
strcpy(diagnostic->error, message);
return diagnostic;
}