]> git.sur5r.net Git - openldap/blobdiff - libraries/librewrite/rule.c
Fix UTF8StringNormalize overrun on zero-length string
[openldap] / libraries / librewrite / rule.c
index 6c62c3b9fbfb03589d85c2869db38a6454871df1..6f80f161e41c3d6a4659dbd037bd93cdf5c8ed2c 100644 (file)
@@ -1,7 +1,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2000-2009 The OpenLDAP Foundation.
+ * Copyright 2000-2011 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -125,7 +125,7 @@ rewrite_rule_compile(
 {
        int flags = REWRITE_REGEX_EXTENDED | REWRITE_REGEX_ICASE;
        int mode = REWRITE_RECURSE;
-       int max_passes = info->li_max_passes_per_rule;
+       int max_passes;
 
        struct rewrite_rule *rule = NULL;
        struct rewrite_subst *subst = NULL;
@@ -137,11 +137,12 @@ rewrite_rule_compile(
        assert( context != NULL );
        assert( pattern != NULL );
        assert( result != NULL );
-
        /*
         * A null flagstring should be allowed
         */
 
+       max_passes = info->li_max_passes_per_rule;
+
        /*
         * Take care of substitution string
         */