mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 07:42:04 +00:00
Bug 751643 - ensure that strings produced by ANGLE's getVariableInfo function are null-terminated - r=bz,upstream
Checked in upstream ANGLE as r1070.
This commit is contained in:
parent
4ebdb294b4
commit
4b973ad9e6
@ -72,12 +72,14 @@ static void getVariableInfo(ShShaderInfo varType,
|
||||
int activeUniformAndAttribLength = 1 + MAX_SYMBOL_NAME_LEN;
|
||||
ASSERT(checkActiveUniformAndAttribMaxLengths(handle, activeUniformAndAttribLength));
|
||||
strncpy(name, varInfo.name.c_str(), activeUniformAndAttribLength);
|
||||
name[activeUniformAndAttribLength - 1] = 0;
|
||||
if (mappedName) {
|
||||
// This size must match that queried by
|
||||
// SH_MAPPED_NAME_MAX_LENGTH in ShGetInfo, below.
|
||||
int maxMappedNameLength = 1 + MAX_SYMBOL_NAME_LEN;
|
||||
ASSERT(checkMappedNameMaxLength(handle, maxMappedNameLength));
|
||||
strncpy(mappedName, varInfo.mappedName.c_str(), maxMappedNameLength);
|
||||
mappedName[maxMappedNameLength - 1] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user