Don't allocate r/s in DSA_SIG and ECDSA_SIG
[oweals/openssl.git] / crypto / dsa / dsa_ossl.c
index 8913fcccd3435bb8cfa0be17622f318d726688e4..f9f6a136fbee82f97b2ceacc64fdb05470226bd3 100644 (file)
@@ -69,6 +69,10 @@ static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa)
     ret = DSA_SIG_new();
     if (ret == NULL)
         goto err;
+    ret->r = BN_new();
+    ret->s = BN_new();
+    if (ret->r == NULL || ret->s == NULL)
+        goto err;
 
     ctx = BN_CTX_new();
     if (ctx == NULL)