Update perl asm scripts include paths for perlasm.
[openssl.git] / crypto / asn1 / a_utctm.c
index fea65903220fcc720ba96ba49a12af440218e9ad..2d15ff3c14e0d78e82b794ff8395360398e17c77 100644 (file)
@@ -114,8 +114,8 @@ err:
 
 int ASN1_UTCTIME_check(ASN1_UTCTIME *d)
        {
-       static int min[8]={ 0, 1, 1, 0, 0, 0, 0, 0};
-       static int max[8]={99,12,31,23,59,59,12,59};
+       static const int min[8]={ 0, 1, 1, 0, 0, 0, 0, 0};
+       static const int max[8]={99,12,31,23,59,59,12,59};
        char *a;
        int n,i,l,o;
 
@@ -173,8 +173,9 @@ int ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, const char *str)
                {
                if (s != NULL)
                        {
-                       ASN1_STRING_set((ASN1_STRING *)s,
-                               (unsigned char *)str,t.length);
+                       if (!ASN1_STRING_set((ASN1_STRING *)s,
+                               (unsigned char *)str,t.length))
+                               return 0;
                        s->type = V_ASN1_UTCTIME;
                        }
                return(1);
@@ -203,7 +204,11 @@ ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t)
        if ((p == NULL) || ((size_t)s->length < len))
                {
                p=OPENSSL_malloc(len);
-               if (p == NULL) return(NULL);
+               if (p == NULL)
+                       {
+                       ASN1err(ASN1_F_ASN1_UTCTIME_SET,ERR_R_MALLOC_FAILURE);
+                       return(NULL);
+                       }
                if (s->data != NULL)
                        OPENSSL_free(s->data);
                s->data=(unsigned char *)p;