From 6cdfa91143b7c141c012b67cf625cd7b6e989e5b Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Thu, 14 Aug 2008 14:38:21 +0000 Subject: [PATCH] g_return_if_fail if either username or password is NULL. Noted on the * libsoup/soup-auth.c (soup_auth_authenticate): g_return_if_fail if either username or password is NULL. Noted on the mailing list. * libsoup/soup-auth-basic.c (authenticate): remove redundant check svn path=/trunk/; revision=1152 --- ChangeLog | 8 +++++++- libsoup/soup-auth-basic.c | 3 --- libsoup/soup-auth.c | 3 ++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index e84bee9..1496c7d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,7 +2,13 @@ * libsoup.pc.in (Requires): Add gthread-2.0; the app must call g_thread_init(), but libsoup won't pull it in itself if built with - --as-needed, so make sure it gets pulled in from here. + --as-needed, so make sure it gets pulled in from here. Noted by + Zeeshan Ali. + + * libsoup/soup-auth.c (soup_auth_authenticate): g_return_if_fail + if either username or password is NULL. Noted on the mailing list. + + * libsoup/soup-auth-basic.c (authenticate): remove redundant check 2008-08-04 Dan Winship diff --git a/libsoup/soup-auth-basic.c b/libsoup/soup-auth-basic.c index 35f4708..cf8bf47 100644 --- a/libsoup/soup-auth-basic.c +++ b/libsoup/soup-auth-basic.c @@ -106,9 +106,6 @@ authenticate (SoupAuth *auth, const char *username, const char *password) char *user_pass; int len; - g_return_if_fail (username != NULL); - g_return_if_fail (password != NULL); - user_pass = g_strdup_printf ("%s:%s", username, password); len = strlen (user_pass); diff --git a/libsoup/soup-auth.c b/libsoup/soup-auth.c index 9144ec0..dc855cc 100644 --- a/libsoup/soup-auth.c +++ b/libsoup/soup-auth.c @@ -302,7 +302,8 @@ soup_auth_authenticate (SoupAuth *auth, const char *username, const char *passwo gboolean was_authenticated; g_return_if_fail (SOUP_IS_AUTH (auth)); - g_return_if_fail (username != NULL || password == NULL); + g_return_if_fail (username != NULL); + g_return_if_fail (password != NULL); was_authenticated = soup_auth_is_authenticated (auth); SOUP_AUTH_GET_CLASS (auth)->authenticate (auth, username, password); -- 2.7.4