fix: null-terminate versionSubstring in OGLGetDriverVersion
This commit is contained in:
parent
6690a8cedd
commit
6f1d4e1d5c
|
@ -733,7 +733,8 @@ static void OGLGetDriverVersion(const char *oglVersionString,
|
|||
}
|
||||
|
||||
// Copy the version substring and parse it.
|
||||
char *versionSubstring = (char *)malloc(versionStringLength * sizeof(char));
|
||||
char *versionSubstring = (char *)malloc((versionStringLength + 1) * sizeof(char));
|
||||
versionSubstring[versionStringLength] = '\0';
|
||||
strncpy(versionSubstring, versionStrStart, versionStringLength);
|
||||
|
||||
unsigned int major = 0;
|
||||
|
|
Loading…
Reference in New Issue