]> git.sur5r.net Git - openldap/commitdiff
ITS#4648, alternate fix
authorHoward Chu <hyc@openldap.org>
Wed, 10 Jan 2007 08:52:07 +0000 (08:52 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 10 Jan 2007 08:52:07 +0000 (08:52 +0000)
libraries/libldap/filter.c

index 973e127b3e8787707f06abad86ac0e71e8143e7e..6709540885ea4080d5b5431536588afd6201e46c 100644 (file)
@@ -422,6 +422,10 @@ ldap_pvt_put_filter( BerElement *ber, const char *str_in )
                                parens--;
                                break;
 
+                       case '(':
+                               rc = -1;
+                               goto done;
+
                        default:
                                Debug( LDAP_DEBUG_TRACE, "put_filter: simple\n",
                                    0, 0, 0 );
@@ -494,9 +498,11 @@ ldap_pvt_put_filter( BerElement *ber, const char *str_in )
                        str = next;
                        break;
                }
+               if ( !parens )
+                       break;
        }
 
-       rc = parens ? -1 : 0;
+       rc = ( parens || *str ) ? -1 : 0;
 
 done:
        LDAP_FREE( freeme );