From: Hallvard Furuseth Date: Wed, 5 Jan 2011 13:57:31 +0000 (+0000) Subject: Re-fix ITS#6764 (check for ber == NULL _before_ using ber) X-Git-Tag: MIGRATION_CVS2GIT~236 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=360066784ce1700c0550ad6c09aa781de028ca60;p=openldap Re-fix ITS#6764 (check for ber == NULL _before_ using ber) --- diff --git a/libraries/liblber/io.c b/libraries/liblber/io.c index 8b08e38587..40b5acf6bf 100644 --- a/libraries/liblber/io.c +++ b/libraries/liblber/io.c @@ -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 );