diff options
author | Jeffrey Stedfast <fejj@novell.com> | 2004-06-09 23:26:35 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2004-06-09 23:26:35 +0800 |
commit | 8d2043ec63bc9c6998f2a1aea610279313f1f9ad (patch) | |
tree | 6e849b017cbb93f02eade5a08b6a793f2191af7f | |
parent | 1189f447ddb146e7dfee42ed623f8cb01ccdacba (diff) | |
download | gsoc2013-evolution-8d2043ec63bc9c6998f2a1aea610279313f1f9ad.tar gsoc2013-evolution-8d2043ec63bc9c6998f2a1aea610279313f1f9ad.tar.gz gsoc2013-evolution-8d2043ec63bc9c6998f2a1aea610279313f1f9ad.tar.bz2 gsoc2013-evolution-8d2043ec63bc9c6998f2a1aea610279313f1f9ad.tar.lz gsoc2013-evolution-8d2043ec63bc9c6998f2a1aea610279313f1f9ad.tar.xz gsoc2013-evolution-8d2043ec63bc9c6998f2a1aea610279313f1f9ad.tar.zst gsoc2013-evolution-8d2043ec63bc9c6998f2a1aea610279313f1f9ad.zip |
Fixed a case where it was possible to double-free the gpg context.
2004-06-09 Jeffrey Stedfast <fejj@novell.com>
* camel-gpg-context.c (gpg_verify): Fixed a case where it was
possible to double-free the gpg context.
(gpg_verify): If we don't have a public key, then the signature is
just BAD always.
svn path=/trunk/; revision=26271
-rw-r--r-- | camel/ChangeLog | 7 | ||||
-rw-r--r-- | camel/camel-gpg-context.c | 10 |
2 files changed, 11 insertions, 6 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index c4faefa9ad..26a4bb4c2e 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,10 @@ +2004-06-09 Jeffrey Stedfast <fejj@novell.com> + + * camel-gpg-context.c (gpg_verify): Fixed a case where it was + possible to double-free the gpg context. + (gpg_verify): If we don't have a public key, then the signature is + just BAD always. + 2004-06-09 Jeffrey Stedfast <fejj@ximian.com> * camel-gpg-context.c (gpg_verify): Don't assign trust to be diff --git a/camel/camel-gpg-context.c b/camel/camel-gpg-context.c index 9c367a6e24..adcd40cb17 100644 --- a/camel/camel-gpg-context.c +++ b/camel/camel-gpg-context.c @@ -715,7 +715,7 @@ gpg_ctx_parse_status (struct _GpgCtx *gpg, CamelException *ex) *inptr++ = '\0'; status = gpg->statusbuf; - d(printf ("status: %s\n", status)); + printf ("status: %s\n", status); if (strncmp (status, "[GNUPG:] ", 9) != 0) { camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, @@ -1431,7 +1431,6 @@ gpg_verify (CamelCipherContext *context, CamelMimePart *ipart, CamelException *e if (gpg_ctx_op_start (gpg) == -1) { camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, _("Failed to execute gpg.")); - gpg_ctx_free (gpg); goto exception; } @@ -1460,8 +1459,6 @@ gpg_verify (CamelCipherContext *context, CamelMimePart *ipart, CamelException *e validity->sign.status = CAMEL_CIPHER_VALIDITY_SIGN_GOOD; else validity->sign.status = CAMEL_CIPHER_VALIDITY_SIGN_BAD; - } else if (!gpg->nodata && gpg->nopubkey) { - validity->sign.status = CAMEL_CIPHER_VALIDITY_SIGN_UNKNOWN; } else { validity->sign.status = CAMEL_CIPHER_VALIDITY_SIGN_BAD; } @@ -1477,8 +1474,9 @@ gpg_verify (CamelCipherContext *context, CamelMimePart *ipart, CamelException *e exception: - gpg_ctx_free (gpg); - + if (gpg != NULL) + gpg_ctx_free (gpg); + if (istream) camel_object_unref(istream); |