X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/5c19dc3ae3bd8e40a9c028b0deddd50ff337692c..7e6b461318c8a779d91381531435a68ee4e8b6ed:/OSX/libsecurity_ocspd/common/ocspdUtils.cpp diff --git a/OSX/libsecurity_ocspd/common/ocspdUtils.cpp b/OSX/libsecurity_ocspd/common/ocspdUtils.cpp index efbdb8a6..abaa658f 100644 --- a/OSX/libsecurity_ocspd/common/ocspdUtils.cpp +++ b/OSX/libsecurity_ocspd/common/ocspdUtils.cpp @@ -217,7 +217,7 @@ CFAbsoluteTime genTimeToCFAbsTime( } } while(toGo != 0); - if(str[strLen - 1] == 'Z') { + if(strLen >= 1 && str[strLen - 1] == 'Z') { isGMT = true; strLen--; } @@ -267,6 +267,8 @@ void cfAbsTimeToGgenTime( /* time zone = GMT */ CFTimeZoneRef tz = CFTimeZoneCreateWithTimeIntervalFromGMT(NULL, 0.0); CFGregorianDate greg = CFAbsoluteTimeGetGregorianDate(absTime, tz); + CFRelease(tz); + int seconds = (int)greg.second; sprintf(genTime, "%04d%02d%02d%02d%02d%02dZ", (int)greg.year, greg.month, greg.day, greg.hour,