Unchecked malloc fixes
[openssl.git] / apps / dgst.c
index adb7a060a2822ffa184933e00914a9288df40245..47c2f69e1b5738c893fa43cda4ba84eb4413a1a1 100644 (file)
@@ -460,6 +460,11 @@ int MAIN(int argc, char **argv)
             ERR_print_errors(bio_err);
             goto end;
         }
+        if (!sigbuf) {
+            BIO_printf(bio_err, "Out of memory\n");
+            ERR_print_errors(bio_err);
+            goto end;
+        }
         siglen = BIO_read(sigbio, sigbuf, siglen);
         BIO_free(sigbio);
         if (siglen <= 0) {