cipher: Improve fatal error message for bad use of gcry_md_read.
authorWerner Koch <wk@gnupg.org>
Thu, 23 Jun 2016 08:29:08 +0000 (10:29 +0200)
committerWerner Koch <wk@gnupg.org>
Sat, 25 Jun 2016 13:38:49 +0000 (15:38 +0200)
* cipher/md.c (md_read): Use _gcry_fatal_error instead of BUG.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
cipher/md.c

index d0ef00f..344c1f2 100644 (file)
@@ -847,7 +847,7 @@ md_read( gcry_md_hd_t a, int algo )
            return r->spec->read (&r->context.c);
          }
     }
-  BUG();
+  _gcry_fatal_error (GPG_ERR_DIGEST_ALGO, "request algo not in md context");
   return NULL;
 }