[gmime/gmime-2-4] Don't crash if the session's request_passwd func is NULL
- From: Jeffrey Stedfast <fejj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gmime/gmime-2-4] Don't crash if the session's request_passwd func is NULL
- Date: Wed, 8 Jun 2011 15:52:28 +0000 (UTC)
commit b4c92a7f4c6bc754a0c96c22c86c4e6e493ebcc2
Author: Jeffrey Stedfast <fejj gnome org>
Date: Wed Jun 8 11:51:55 2011 -0400
Don't crash if the session's request_passwd func is NULL
2011-06-08 Jeffrey Stedfast <fejj gnome org>
* gmime/gmime-session.c: Don't crash if the request_passwd()
virtual method is set to NULL. Fixes bug #651825.
ChangeLog | 5 +++++
gmime/gmime-session.c | 8 ++++++--
2 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 18c08d2..f4a2f2c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2011-06-08 Jeffrey Stedfast <fejj gnome org>
+ * gmime/gmime-session.c: Don't crash if the request_passwd()
+ virtual method is set to NULL. Fixes bug #651825.
+
+2011-06-08 Jeffrey Stedfast <fejj gnome org>
+
* gmime/gmime-gpg-context.c: If building on Apple, force the use
of our own implementation of poll() because Apple's poll() is
broken on some versions of MacOS.
diff --git a/gmime/gmime-session.c b/gmime/gmime-session.c
index 02dab39..ccbb915 100644
--- a/gmime/gmime-session.c
+++ b/gmime/gmime-session.c
@@ -160,7 +160,10 @@ g_mime_session_request_passwd (GMimeSession *session, const char *prompt,
{
g_return_val_if_fail (GMIME_IS_SESSION (session), NULL);
- return GMIME_SESSION_GET_CLASS (session)->request_passwd (session, prompt, secret, item, err);
+ if (GMIME_SESSION_GET_CLASS (session)->request_passwd)
+ return GMIME_SESSION_GET_CLASS (session)->request_passwd (session, prompt, secret, item, err);
+ else
+ return session_request_passwd (session, prompt, secret, item, err);
}
@@ -185,5 +188,6 @@ g_mime_session_forget_passwd (GMimeSession *session, const char *item, GError **
{
g_return_if_fail (GMIME_IS_SESSION (session));
- GMIME_SESSION_GET_CLASS (session)->forget_passwd (session, item, err);
+ if (GMIME_SESSION_GET_CLASS (session)->forget_passwd)
+ GMIME_SESSION_GET_CLASS (session)->forget_passwd (session, item, err);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]