]> git.saurik.com Git - apple/security.git/blobdiff - OSX/libsecurity_ocspd/common/ocspdUtils.cpp
Security-59306.61.1.tar.gz
[apple/security.git] / OSX / libsecurity_ocspd / common / ocspdUtils.cpp
index efbdb8a6b11df3e85bc4e91d6d6053016d4f2d83..abaa658ff5f485465c85b0c7d7123facfb5f25f5 100644 (file)
@@ -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,