Skip to content

Commit ea848ec

Browse files
James Groffensimo5
authored andcommitted
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
1 parent 7f11db9 commit ea848ec

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/environ.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,10 @@ gss_buffer_desc empty_buffer = GSS_C_EMPTY_BUFFER;
152152
void mag_get_name_attributes(request_rec *req, struct mag_config *cfg,
153153
gss_name_t name, struct mag_conn *mc)
154154
{
155+
if (!cfg->name_attributes) {
156+
return;
157+
}
158+
155159
uint32_t maj, min;
156160
gss_buffer_set_t attrs = GSS_C_NO_BUFFER_SET;
157161
struct name_attr attr;

0 commit comments

Comments
 (0)