Fix Savannah bug #38970. * src/base/ftdebug.c, builds/win32/ftdebug.c, builds/wince/ftdebug.c, builds/amiga/src/base/ftdebug.c (ft_debug_init): Don't read past the environment variable FT2_DEBUG.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
diff --git a/ChangeLog b/ChangeLog
index 050408d..e1b5c91 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2013-05-13 Brian Nixon <bnixon@yahoo.com>
+
+ Fix Savannah bug #38970.
+
+ * src/base/ftdebug.c, builds/win32/ftdebug.c,
+ builds/wince/ftdebug.c, builds/amiga/src/base/ftdebug.c
+ (ft_debug_init): Don't read past the environment variable FT2_DEBUG.
+
2013-05-12 Werner Lemberg <wl@gnu.org>
[truetype] Add framework for TrueType properties.
diff --git a/builds/amiga/src/base/ftdebug.c b/builds/amiga/src/base/ftdebug.c
index d3c5ead..4e13a6a 100644
--- a/builds/amiga/src/base/ftdebug.c
+++ b/builds/amiga/src/base/ftdebug.c
@@ -208,6 +208,9 @@
while ( *p && *p != ':' )
p++;
+ if ( !*p )
+ break;
+
if ( *p == ':' && p > q )
{
FT_Int n, i, len = (FT_Int)( p - q );
@@ -236,7 +239,7 @@
p++;
if ( *p )
{
- level = *p++ - '0';
+ level = *p - '0';
if ( level < 0 || level > 7 )
level = -1;
}
diff --git a/builds/win32/ftdebug.c b/builds/win32/ftdebug.c
index baf1d4a..832eb0f 100644
--- a/builds/win32/ftdebug.c
+++ b/builds/win32/ftdebug.c
@@ -166,6 +166,9 @@
while ( *p && *p != ':' )
p++;
+ if ( !*p )
+ break;
+
if ( *p == ':' && p > q )
{
int n, i, len = p - q;
@@ -194,7 +197,7 @@
p++;
if ( *p )
{
- level = *p++ - '0';
+ level = *p - '0';
if ( level < 0 || level > 7 )
level = -1;
}
diff --git a/builds/wince/ftdebug.c b/builds/wince/ftdebug.c
index cd105dc..3c8d328 100644
--- a/builds/wince/ftdebug.c
+++ b/builds/wince/ftdebug.c
@@ -184,6 +184,9 @@
while ( *p && *p != ':' )
p++;
+ if ( !*p )
+ break;
+
if ( *p == ':' && p > q )
{
int n, i, len = p - q;
@@ -212,7 +215,7 @@
p++;
if ( *p )
{
- level = *p++ - '0';
+ level = *p - '0';
if ( level < 0 || level > 7 )
level = -1;
}
diff --git a/src/base/ftdebug.c b/src/base/ftdebug.c
index 67735fc..b9156d1 100644
--- a/src/base/ftdebug.c
+++ b/src/base/ftdebug.c
@@ -181,6 +181,9 @@
while ( *p && *p != ':' )
p++;
+ if ( !*p )
+ break;
+
if ( *p == ':' && p > q )
{
FT_Int n, i, len = (FT_Int)( p - q );
@@ -209,7 +212,7 @@
p++;
if ( *p )
{
- level = *p++ - '0';
+ level = *p - '0';
if ( level < 0 || level > 7 )
level = -1;
}