Selaa lähdekoodia

Ticket #617 - Possible to add invalid ACI value

Fix description: The fix enables the syntax check for ACI
even when '(' is not present

https://fedorahosted.org/389/ticket/617

Reviewed by nhosoi.
Anupam Jain 12 vuotta sitten
vanhempi
sitoutus
6041c77a17
1 muutettua tiedostoa jossa 7 lisäystä ja 4 poistoa
  1. 7 4
      ldap/servers/plugins/acl/aclparse.c

+ 7 - 4
ldap/servers/plugins/acl/aclparse.c

@@ -97,8 +97,8 @@ acl_parse(char * str, aci_t *aci_item, char **errbuf)
 {
 
 	int  		rv=0;
-	char 		*next;
-	char 		*save;
+	char 		*next=NULL;
+	char 		*save=NULL;
 
 	while(*str) {
 		__acl_strip_leading_space( &str );
@@ -108,9 +108,12 @@ acl_parse(char * str, aci_t *aci_item, char **errbuf)
 			if ((next = slapi_find_matching_paren(str)) == NULL) {
 				return(ACL_SYNTAX_ERR);
 			}
-		} else {
+		} else if (!next) {
+			/* the statement does not start with a parenthesis */
+                  	return(ACL_SYNTAX_ERR);
+                } else {
 			/* then we have done all the processing */
-			return  0;
+		  	return  0;
 		}
 		LDAP_UTF8INC(str);	/* skip the "(" */
 		save = next;