]> git.sur5r.net Git - openldap/commitdiff
ITS#8199 fix NULL ptr dereference in at_next
authorRyan Tandy <ryan@nardis.ca>
Fri, 17 Jul 2015 22:46:32 +0000 (15:46 -0700)
committerRyan Tandy <rtandy@sd63.bc.ca>
Fri, 17 Jul 2015 23:09:46 +0000 (16:09 -0700)
Deleting all values of olcAttributeTypes and then adding a value with
index > 0 triggers a NULL dereference when config_generic tries to
append to a list that doesn't exist yet.

Already fixed for olcObjectClasses in ITS#5388.

servers/slapd/at.c

index c4d65cfd615a60d2c26db2ec87cc8cbf1e00cfc0..d361d91df50823bf4d3497f784bc7e794871683f 100644 (file)
@@ -365,6 +365,10 @@ at_next( AttributeType **at )
        }
 #endif
 
+       if ( *at == NULL ) {
+               return 0;
+       }
+
        *at = LDAP_STAILQ_NEXT(*at,sat_next);
 
        return (*at != NULL);