From 99376a3c882e222abba92669611149a3d3651d67 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Tue, 10 Jun 2014 15:31:46 -0400 Subject: [PATCH] Fix potential null dereference errors Ina number of cases function inputs are not checked for NULL although values may end up with a NULL value and then they are dereferenced directly. Check values in the function (or the caller) if appropriate. License: MIT Signed-off-by: Simo Sorce --- lasso/id-ff/provider.c | 1 + lasso/saml-2.0/profile.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/lasso/id-ff/provider.c b/lasso/id-ff/provider.c index 397b5e6e..5344cf39 100644 --- a/lasso/id-ff/provider.c +++ b/lasso/id-ff/provider.c @@ -326,6 +326,7 @@ lasso_provider_get_first_http_method(LassoProvider *provider, const gchar *role_prefix; g_return_val_if_fail(LASSO_IS_PROVIDER(provider), LASSO_HTTP_METHOD_NONE); + g_return_val_if_fail(remote_provider != NULL, LASSO_HTTP_METHOD_NONE); if (provider->private_data->conformance == LASSO_PROTOCOL_SAML_2_0) { return lasso_saml20_provider_get_first_http_method( provider, remote_provider, protocol_type); diff --git a/lasso/saml-2.0/profile.c b/lasso/saml-2.0/profile.c index 64854827..106145a4 100644 --- a/lasso/saml-2.0/profile.c +++ b/lasso/saml-2.0/profile.c @@ -933,6 +933,9 @@ lasso_saml20_profile_build_request_msg(LassoProfile *profile, const char *servic if (url) { lasso_assign_string(((LassoSamlp2RequestAbstract*)profile->request)->Destination, url); + } else { + rc = LASSO_PROFILE_ERROR_UNKNOWN_PROFILE_URL; + goto cleanup; } switch (method) {