[libxslt] Check for overflow in _exsltDateParseGYear



commit d86cb0b5d75e0312f4e22d23af56c3a76f689edb
Author: Nick Wellnhofer <wellnhofer aevum de>
Date:   Thu May 18 17:25:46 2017 +0200

    Check for overflow in _exsltDateParseGYear
    
    Fixes bug #765379:
    
        https://bugzilla.gnome.org/show_bug.cgi?id=765379

 libexslt/date.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/libexslt/date.c b/libexslt/date.c
index 220d71d..dd75a44 100644
--- a/libexslt/date.c
+++ b/libexslt/date.c
@@ -220,6 +220,8 @@ _exsltDateParseGYear (exsltDateValPtr dt, const xmlChar **str)
     firstChar = cur;
 
     while ((*cur >= '0') && (*cur <= '9')) {
+        if (dt->year >= LONG_MAX / 10)
+            return -1;
        dt->year = dt->year * 10 + (*cur - '0');
        cur++;
        digcnt++;


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