aboutsummaryrefslogtreecommitdiff
path: root/xkbcomp/xkbscan.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-04-05 14:52:19 +0000
committermarha <marha@users.sourceforge.net>2011-04-05 14:52:19 +0000
commit6254e74e8b2ff8a2a1e8476a3300a7bdd65b7ad6 (patch)
tree02e0d5fd297602d526b582dc527e007fe20a326f /xkbcomp/xkbscan.c
parent1d142834bdb30308784a0654a39b7c0de7e37695 (diff)
parenteaedc21febeadad4cf0e370f5d97e7bdb4470870 (diff)
downloadvcxsrv-6254e74e8b2ff8a2a1e8476a3300a7bdd65b7ad6.tar.gz
vcxsrv-6254e74e8b2ff8a2a1e8476a3300a7bdd65b7ad6.tar.bz2
vcxsrv-6254e74e8b2ff8a2a1e8476a3300a7bdd65b7ad6.zip
svn merge ^/branches/released .
Diffstat (limited to 'xkbcomp/xkbscan.c')
-rw-r--r--xkbcomp/xkbscan.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/xkbcomp/xkbscan.c b/xkbcomp/xkbscan.c
index caf9f7ef0..c9f88cc37 100644
--- a/xkbcomp/xkbscan.c
+++ b/xkbcomp/xkbscan.c
@@ -606,14 +606,16 @@ yyGetIdent(int first)
static int
yyGetNumber(int ch)
{
+ #define nMaxBuffSize 1024
int isFloat = 0;
- char buf[1024];
+ char buf[nMaxBuffSize];
int nInBuf = 0;
buf[0] = ch;
nInBuf = 1;
while (((ch = scanchar()) != EOF)
- && (isxdigit(ch) || ((nInBuf == 1) && (ch == 'x'))))
+ && (isxdigit(ch) || ((nInBuf == 1) && (ch == 'x')))
+ && nInBuf < nMaxBuffSize)
{
buf[nInBuf++] = ch;
}
@@ -621,7 +623,8 @@ yyGetNumber(int ch)
{
isFloat = 1;
buf[nInBuf++] = ch;
- while (((ch = scanchar()) != EOF) && (isxdigit(ch)))
+ while (((ch = scanchar()) != EOF) && (isxdigit(ch))
+ && nInBuf < nMaxBuffSize)
{
buf[nInBuf++] = ch;
}