diff options
author | Werner Koch <[email protected]> | 2014-11-28 11:20:42 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2014-11-28 11:20:42 +0000 |
commit | e59b1cc7471dd161a627b290c645ef7bd0d9d42c (patch) | |
tree | 7f828285628d0f98de0618450515ffb616bb85c3 | |
parent | Add option --no-autostart. (diff) | |
download | gnupg-e59b1cc7471dd161a627b290c645ef7bd0d9d42c.tar.gz gnupg-e59b1cc7471dd161a627b290c645ef7bd0d9d42c.zip |
gpg: Change another BUG() call to a regular error message.
* g10/mainproc.c (proc_tree): Replace BUG by a proper error messages.
Signed-off-by: Werner Koch <[email protected]>
-rw-r--r-- | g10/mainproc.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/g10/mainproc.c b/g10/mainproc.c index d908d5795..03a13c55e 100644 --- a/g10/mainproc.c +++ b/g10/mainproc.c @@ -2123,8 +2123,9 @@ proc_tree (CTX c, kbnode_t node) free_md_filter_context (&c->mfx); /* Prepare to create all requested message digests. */ - if (gcry_md_open (&c->mfx.md, 0, 0)) - BUG (); + rc = gcry_md_open (&c->mfx.md, 0, 0); + if (rc) + goto hash_err; /* Fixme: why looking for the signature packet and not the one-pass packet? */ @@ -2154,6 +2155,7 @@ proc_tree (CTX c, kbnode_t node) use_textmode); } + hash_err: if (rc) { log_error ("can't hash datafile: %s\n", g10_errstr (rc)); @@ -2225,8 +2227,9 @@ proc_tree (CTX c, kbnode_t node) { /* Detached signature */ free_md_filter_context (&c->mfx); - if (gcry_md_open (&c->mfx.md, sig->digest_algo, 0)) - BUG (); + rc = gcry_md_open (&c->mfx.md, sig->digest_algo, 0); + if (rc) + goto detached_hash_err; if (RFC2440 || RFC4880) ; /* Strict RFC mode. */ @@ -2236,8 +2239,9 @@ proc_tree (CTX c, kbnode_t node) { /* Enable a workaround for a pgp5 bug when the detached * signature has been created in textmode. */ - if (gcry_md_open (&c->mfx.md2, sig->digest_algo, 0 )) - BUG (); + rc = gcry_md_open (&c->mfx.md2, sig->digest_algo, 0); + if (rc) + goto detached_hash_err; } /* Here we used to have another hack to work around a pgp @@ -2276,6 +2280,7 @@ proc_tree (CTX c, kbnode_t node) (sig->sig_class == 0x01)); } + detached_hash_err: if (rc) { log_error ("can't hash datafile: %s\n", g10_errstr(rc)); |