From fc32bd4aef656defa2c28b69589ebc34e6c253b5 Mon Sep 17 00:00:00 2001
From: prog.chen <prog.chen@gmail.com>
Date: Tue, 14 Jan 2014 19:32:47 +0800
Subject: [PATCH] fix cookie max-age field integer overflow bug in libcurl

---
 lib/cookie.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/cookie.c b/lib/cookie.c
index c597326..15479fe 100644
--- a/lib/cookie.c
+++ b/lib/cookie.c
@@ -490,8 +490,8 @@ Curl_cookie_add(struct SessionHandle *data,
             break;
           }
           co->expires =
-            strtol((*co->maxage=='\"')?&co->maxage[1]:&co->maxage[0],NULL,10)
-            + (long)now;
+            (curl_off_t)strtol((*co->maxage=='\"')?&co->maxage[1]:&co->maxage[0],NULL,10)
+            + (curl_off_t)now;
         }
         else if(Curl_raw_equal("expires", name)) {
           strstore(&co->expirestr, whatptr);
-- 
1.7.9.5

