Add additional DigestInfo checks.
[openssl.git] / crypto / asn1 / a_int.c
index 3348b8762cc4026bbad7508be9385e43aeb884dc..297c45a9ff12ebb54df717bd7c1f8487579daad4 100644 (file)
@@ -116,7 +116,7 @@ int i2c_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp)
        int pad=0,ret,i,neg;
        unsigned char *p,*n,pb=0;
 
-       if ((a == NULL) || (a->data == NULL)) return(0);
+       if (a == NULL) return(0);
        neg=a->type & V_ASN1_NEG;
        if (a->length == 0)
                ret=1;
@@ -386,8 +386,8 @@ long ASN1_INTEGER_get(const ASN1_INTEGER *a)
        
        if (a->length > (int)sizeof(long))
                {
-               /* hmm... a bit ugly */
-               return(0xffffffffL);
+               /* hmm... a bit ugly, return all ones */
+               return -1;
                }
        if (a->data == NULL)
                return 0;