]> git.sur5r.net Git - openldap/commitdiff
Re-fix ITS#6764 (check for ber == NULL _before_ using ber)
authorQuanah Gibson-Mount <quanah@openldap.org>
Thu, 6 Jan 2011 19:51:14 +0000 (19:51 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Thu, 6 Jan 2011 19:51:14 +0000 (19:51 +0000)
libraries/liblber/io.c

index 8b08e385876cba4d83e4cfa30cd579875ad6fc25..40b5acf6bf364f481b3111aa1d76274da8bcf8ee 100644 (file)
@@ -390,16 +390,15 @@ int ber_flatten2(
                return -1;
        }
 
-       /* unmatched "{" and "}" */
-       if ( ber->ber_sos_ptr != NULL ) {
-               return -1;
-       }
-
        if ( ber == NULL ) {
                /* ber is null, create an empty berval */
                bv->bv_val = NULL;
                bv->bv_len = 0;
 
+       } else if ( ber->ber_sos_ptr != NULL ) {
+               /* unmatched "{" and "}" */
+               return -1;
+
        } else {
                /* copy the berval */
                ber_len_t len = ber_pvt_ber_write( ber );