Merge pull request #860 from En-En-Code/oglgetdriverversion-fix

fix: null-terminate versionSubstring in OGLGetDriverVersion
This commit is contained in:
zeromus 2024-11-02 22:24:35 -04:00 committed by GitHub
commit f51e19b19b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -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;