A round of increasing robustness against buffer overruns.

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@21917 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich 2013-06-10 07:36:26 +00:00
parent 7408a69952
commit 00f605b930
11 changed files with 98 additions and 32 deletions

View file

@ -185,4 +185,6 @@ __inline TPersistString FormatSourceLoc(const TSourceLoc loc)
typedef TMap<TString, TString> TPragmaTable;
typedef TMap<TString, TString>::tAllocator TPragmaTableAllocator;
const int GlslangMaxTokenLength = 1024;
#endif // _COMMON_INCLUDED_

View file

@ -40,6 +40,8 @@
#include "../Include/Common.h"
#include "../Include/BaseTypes.h"
const int GlslangMaxTypeLength = 200;
//
// Details within a sampler type
//
@ -602,7 +604,7 @@ public:
TString getCompleteString() const
{
const int maxSize = 200;
const int maxSize = GlslangMaxTypeLength;
char buf[maxSize];
char *p = &buf[0];
char *end = &buf[maxSize];