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 <simo@redhat.com>
This commit is contained in:
Simo Sorce 2014-06-10 15:31:46 -04:00 committed by Benjamin Dauvergne
parent 1b955021a5
commit 99376a3c88
2 changed files with 4 additions and 0 deletions

View File

@ -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);

View File

@ -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) {