freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2] master 0e7b9f8 1/3: [psaux] Correctly handle sequences of mu


From: Werner LEMBERG
Subject: [freetype2] master 0e7b9f8 1/3: [psaux] Correctly handle sequences of multiple number signs.
Date: Wed, 31 May 2017 10:17:48 -0400 (EDT)

branch: master
commit 0e7b9f864f517dfe0bc37419c037dd299fdd2a27
Author: Werner Lemberg <address@hidden>
Commit: Werner Lemberg <address@hidden>

    [psaux] Correctly handle sequences of multiple number signs.
    
    * src/psaux/psconv.c (PS_Conv_Strtol, PS_Conv_ToFixed): Return zero
    if we encounter more than a single sign.
---
 ChangeLog          | 7 +++++++
 src/psaux/psconv.c | 8 ++++++++
 2 files changed, 15 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 8a66677..9c79afe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2017-05-30  Werner Lemberg  <address@hidden>
+
+       [psaux] Correctly handle sequences of multiple number signs.
+
+       * src/psaux/psconv.c (PS_Conv_Strtol, PS_Conv_ToFixed): Return zero
+       if we encounter more than a single sign.
+
 2017-05-29  Werner Lemberg  <address@hidden>
 
        [pcf] 32bit integer overflow run-time errors (#46149).
diff --git a/src/psaux/psconv.c b/src/psaux/psconv.c
index b092482..d125b08 100644
--- a/src/psaux/psconv.c
+++ b/src/psaux/psconv.c
@@ -111,6 +111,10 @@
       p++;
       if ( p == limit )
         goto Bad;
+
+      /* only a single sign is allowed */
+      if ( *p == '-' || *p == '+' )
+        return 0;
     }
 
     num_limit = 0x7FFFFFFFL / base;
@@ -215,6 +219,10 @@
       p++;
       if ( p == limit )
         goto Bad;
+
+      /* only a single sign is allowed */
+      if ( *p == '-' || *p == '+' )
+        return 0;
     }
 
     /* read the integer part */



reply via email to

[Prev in Thread] Current Thread [Next in Thread]