summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Groffen <james.groffen@dsto.defence.gov.au>2016-01-08 14:43:14 +1030
committerSimo Sorce <simo@redhat.com>2016-01-11 13:48:44 -0500
commitea848ec7ac001d2ea181e7f3e52c8c946cffd15c (patch)
tree261b96375f6ad650e94ddb4fe19b6342cf7df12b
parent7f11db955b8440668fc806b4203f584bb44f58c1 (diff)
downloadmod_auth_gssapi-ea848ec7ac001d2ea181e7f3e52c8c946cffd15c.tar.gz
mod_auth_gssapi-ea848ec7ac001d2ea181e7f3e52c8c946cffd15c.tar.xz
mod_auth_gssapi-ea848ec7ac001d2ea181e7f3e52c8c946cffd15c.zip
Prevent potential null pointer dereference
This commit adds checks to ensure cfg->name_attributes is not null before it is used in mag_get_name_attributes. (Reworded commit message) Reviewed-by: Simo Sorce <simo@redhat.com> Close #64
-rw-r--r--src/environ.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/environ.c b/src/environ.c
index 9ef010b..49b648c 100644
--- a/src/environ.c
+++ b/src/environ.c
@@ -152,6 +152,10 @@ gss_buffer_desc empty_buffer = GSS_C_EMPTY_BUFFER;
void mag_get_name_attributes(request_rec *req, struct mag_config *cfg,
gss_name_t name, struct mag_conn *mc)
{
+ if (!cfg->name_attributes) {
+ return;
+ }
+
uint32_t maj, min;
gss_buffer_set_t attrs = GSS_C_NO_BUFFER_SET;
struct name_attr attr;