summaryrefslogtreecommitdiffstats
path: root/lasso
diff options
context:
space:
mode:
authorDamien Laniel <dlaniel@entrouvert.com>2008-10-01 09:55:40 +0000
committerDamien Laniel <dlaniel@entrouvert.com>2008-10-01 09:55:40 +0000
commit2599e7abb8313338f0ffe2ce7fe8288d883442f7 (patch)
tree4fac34cdfd9a6c324420b5e42daa4a15f3dbd609 /lasso
parentae665ecae8919a1eb24f9598378fc7205432bc87 (diff)
downloadlasso-2599e7abb8313338f0ffe2ce7fe8288d883442f7.tar.gz
lasso-2599e7abb8313338f0ffe2ce7fe8288d883442f7.tar.xz
lasso-2599e7abb8313338f0ffe2ce7fe8288d883442f7.zip
fixed segfaults
Diffstat (limited to 'lasso')
-rw-r--r--lasso/id-wsf/utils.c23
-rw-r--r--lasso/id-wsf/wsf_profile.c6
2 files changed, 19 insertions, 10 deletions
diff --git a/lasso/id-wsf/utils.c b/lasso/id-wsf/utils.c
index 6b774329..570cae13 100644
--- a/lasso/id-wsf/utils.c
+++ b/lasso/id-wsf/utils.c
@@ -33,21 +33,23 @@
*/
#include <glib.h>
-#include <lasso/xml/strings.h>
#include <string.h>
+#include <lasso/xml/strings.h>
+
gboolean
lasso_security_mech_id_is_saml_authentication(const gchar *security_mech_id)
{
- if (!security_mech_id)
+ if (!security_mech_id) {
return FALSE;
-
+ }
if (strcmp(security_mech_id, LASSO_SECURITY_MECH_SAML) == 0 ||
strcmp(security_mech_id, LASSO_SECURITY_MECH_TLS_SAML) == 0 ||
strcmp(security_mech_id, LASSO_SECURITY_MECH_CLIENT_TLS_SAML) == 0 ||
strcmp(security_mech_id, LASSO_SECURITY11_MECH_SAML) == 0 ||
- strcmp(security_mech_id, LASSO_SECURITY11_MECH_TLS_SAML) == 0)
+ strcmp(security_mech_id, LASSO_SECURITY11_MECH_TLS_SAML) == 0) {
return TRUE;
+ }
return FALSE;
}
@@ -64,6 +66,9 @@ lasso_security_mech_id_is_saml_authentication(const gchar *security_mech_id)
gboolean
lasso_security_mech_id_is_x509_authentication(const char *security_mech_id)
{
+ if (!security_mech_id) {
+ return FALSE;
+ }
if (strcmp(security_mech_id, LASSO_SECURITY_MECH_CLIENT_TLS_X509) == 0 ||
strcmp(security_mech_id, LASSO_SECURITY_MECH_TLS_X509) == 0 ||
strcmp(security_mech_id, LASSO_SECURITY_MECH_X509) == 0 ||
@@ -86,7 +91,8 @@ lasso_security_mech_id_is_x509_authentication(const char *security_mech_id)
gboolean
lasso_security_mech_id_is_null_authentication(const char *security_mech_id)
{
- if (strcmp(security_mech_id, LASSO_SECURITY_MECH_CLIENT_TLS) == 0 ||
+ if (security_mech_id == NULL ||
+ strcmp(security_mech_id, LASSO_SECURITY_MECH_CLIENT_TLS) == 0 ||
strcmp(security_mech_id, LASSO_SECURITY_MECH_TLS) == 0 ||
strcmp(security_mech_id, LASSO_SECURITY_MECH_NULL) == 0) {
return TRUE;
@@ -110,15 +116,16 @@ lasso_security_mech_id_is_null_authentication(const char *security_mech_id)
gboolean
lasso_security_mech_id_is_bearer_authentication(const gchar *security_mech_id)
{
- if (!security_mech_id)
+ if (!security_mech_id) {
return FALSE;
-
+ }
if (strcmp(security_mech_id, LASSO_SECURITY_MECH_BEARER) == 0 ||
strcmp(security_mech_id, LASSO_SECURITY_MECH_TLS_BEARER) == 0 ||
strcmp(security_mech_id, LASSO_SECURITY_MECH_CLIENT_TLS_BEARER) == 0 ||
strcmp(security_mech_id, LASSO_SECURITY11_MECH_BEARER) == 0 ||
- strcmp(security_mech_id, LASSO_SECURITY11_MECH_TLS_BEARER) == 0)
+ strcmp(security_mech_id, LASSO_SECURITY11_MECH_TLS_BEARER) == 0) {
return TRUE;
+ }
return FALSE;
}
diff --git a/lasso/id-wsf/wsf_profile.c b/lasso/id-wsf/wsf_profile.c
index d0811da3..61218aa8 100644
--- a/lasso/id-wsf/wsf_profile.c
+++ b/lasso/id-wsf/wsf_profile.c
@@ -694,9 +694,11 @@ lasso_wsf_profile_build_soap_request_msg(LassoWsfProfile *profile)
xmlOutputBufferFlush(buf);
profile->msg_body = g_strdup(
(char*)(buf->conv ? buf->conv->content : buf->buffer->content));
-exit:
- if (buf)
+ if (buf) {
xmlOutputBufferClose(buf);
+ }
+
+exit:
lasso_release_doc(doc);
return rc;
}