Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
angle
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
angle
Commits
b45306b7
Commit
b45306b7
authored
May 07, 2012
by
jacob.benoit.1@gmail.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure that strings produced by getVariableInfo are always null-terminated
Issue 326 git-svn-id:
https://angleproject.googlecode.com/svn/trunk@1070
736b8ea6-26fd-11df-bfd4-992fa37f6226
parent
30a487c7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
1 deletion
+3
-1
version.h
src/common/version.h
+1
-1
ShaderLang.cpp
src/compiler/ShaderLang.cpp
+2
-0
No files found.
src/common/version.h
View file @
b45306b7
#define MAJOR_VERSION 1
#define MAJOR_VERSION 1
#define MINOR_VERSION 0
#define MINOR_VERSION 0
#define BUILD_VERSION 0
#define BUILD_VERSION 0
#define BUILD_REVISION 10
67
#define BUILD_REVISION 10
70
#define STRINGIFY(x) #x
#define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x)
#define MACRO_STRINGIFY(x) STRINGIFY(x)
...
...
src/compiler/ShaderLang.cpp
View file @
b45306b7
...
@@ -72,12 +72,14 @@ static void getVariableInfo(ShShaderInfo varType,
...
@@ -72,12 +72,14 @@ static void getVariableInfo(ShShaderInfo varType,
int
activeUniformAndAttribLength
=
1
+
MAX_SYMBOL_NAME_LEN
;
int
activeUniformAndAttribLength
=
1
+
MAX_SYMBOL_NAME_LEN
;
ASSERT
(
checkActiveUniformAndAttribMaxLengths
(
handle
,
activeUniformAndAttribLength
));
ASSERT
(
checkActiveUniformAndAttribMaxLengths
(
handle
,
activeUniformAndAttribLength
));
strncpy
(
name
,
varInfo
.
name
.
c_str
(),
activeUniformAndAttribLength
);
strncpy
(
name
,
varInfo
.
name
.
c_str
(),
activeUniformAndAttribLength
);
name
[
activeUniformAndAttribLength
-
1
]
=
0
;
if
(
mappedName
)
{
if
(
mappedName
)
{
// This size must match that queried by
// This size must match that queried by
// SH_MAPPED_NAME_MAX_LENGTH in ShGetInfo, below.
// SH_MAPPED_NAME_MAX_LENGTH in ShGetInfo, below.
int
maxMappedNameLength
=
1
+
MAX_SYMBOL_NAME_LEN
;
int
maxMappedNameLength
=
1
+
MAX_SYMBOL_NAME_LEN
;
ASSERT
(
checkMappedNameMaxLength
(
handle
,
maxMappedNameLength
));
ASSERT
(
checkMappedNameMaxLength
(
handle
,
maxMappedNameLength
));
strncpy
(
mappedName
,
varInfo
.
mappedName
.
c_str
(),
maxMappedNameLength
);
strncpy
(
mappedName
,
varInfo
.
mappedName
.
c_str
(),
maxMappedNameLength
);
mappedName
[
maxMappedNameLength
-
1
]
=
0
;
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment