From: Pierangelo Masarati Date: Mon, 26 Feb 2007 23:57:34 +0000 (+0000) Subject: Solaris doesn't like NULL pointers in printf, which now can occur since IA5string... X-Git-Tag: OPENLDAP_REL_ENG_2_4_MP~638 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5d008618600b134b2d9794cb60dc14a30e58d974;p=openldap Solaris doesn't like NULL pointers in printf, which now can occur since IA5string allows the empty string --- diff --git a/servers/slapd/overlays/rwmmap.c b/servers/slapd/overlays/rwmmap.c index c05032a36a..b88cc4a2af 100644 --- a/servers/slapd/overlays/rwmmap.c +++ b/servers/slapd/overlays/rwmmap.c @@ -499,7 +499,7 @@ rwm_int_filter_map_rewrite( fstr->bv_val = ch_malloc( fstr->bv_len + 1 ); snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s=%s)", - atmp.bv_val, vtmp.bv_val ); + atmp.bv_val, vtmp.bv_len ? vtmp.bv_val : "" ); ch_free( vtmp.bv_val ); break; @@ -516,7 +516,7 @@ rwm_int_filter_map_rewrite( fstr->bv_val = ch_malloc( fstr->bv_len + 1 ); snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s>=%s)", - atmp.bv_val, vtmp.bv_val ); + atmp.bv_val, vtmp.bv_len ? vtmp.bv_val : "" ); ch_free( vtmp.bv_val ); break; @@ -533,7 +533,7 @@ rwm_int_filter_map_rewrite( fstr->bv_val = ch_malloc( fstr->bv_len + 1 ); snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s<=%s)", - atmp.bv_val, vtmp.bv_val ); + atmp.bv_val, vtmp.bv_len ? vtmp.bv_val : "" ); ch_free( vtmp.bv_val ); break; @@ -550,7 +550,7 @@ rwm_int_filter_map_rewrite( fstr->bv_val = ch_malloc( fstr->bv_len + 1 ); snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s~=%s)", - atmp.bv_val, vtmp.bv_val ); + atmp.bv_val, vtmp.bv_len ? vtmp.bv_val : "" ); ch_free( vtmp.bv_val ); break; @@ -581,7 +581,7 @@ rwm_int_filter_map_rewrite( snprintf( &fstr->bv_val[len - 2], vtmp.bv_len + 3, /* "(attr=" */ "%s*)", - vtmp.bv_val ); + vtmp.bv_len ? vtmp.bv_val : "" ); ch_free( vtmp.bv_val ); } @@ -596,7 +596,7 @@ rwm_int_filter_map_rewrite( snprintf( &fstr->bv_val[len - 1], vtmp.bv_len + 3, /* "(attr=[init]*[any*]" */ "%s*)", - vtmp.bv_val ); + vtmp.bv_len ? vtmp.bv_val : "" ); ch_free( vtmp.bv_val ); } } @@ -611,7 +611,7 @@ rwm_int_filter_map_rewrite( snprintf( &fstr->bv_val[len - 1], vtmp.bv_len + 3, /* "(attr=[init*][any*]" */ "%s)", - vtmp.bv_val ); + vtmp.bv_len ? vtmp.bv_val : "" ); ch_free( vtmp.bv_val ); } @@ -657,7 +657,7 @@ rwm_int_filter_map_rewrite( fstr->bv_val = ch_realloc( fstr->bv_val, fstr->bv_len + 1 ); snprintf( &fstr->bv_val[len-1], vtmp.bv_len + 2, - /*"("*/ "%s)", vtmp.bv_val ); + /*"("*/ "%s)", vtmp.bv_len ? vtmp.bv_val : "" ); ch_free( vtmp.bv_val ); } @@ -690,7 +690,7 @@ rwm_int_filter_map_rewrite( f->f_mr_dnattrs ? ":dn" : "", !BER_BVISEMPTY( &f->f_mr_rule_text ) ? ":" : "", !BER_BVISEMPTY( &f->f_mr_rule_text ) ? f->f_mr_rule_text.bv_val : "", - vtmp.bv_val ); + vtmp.bv_len ? vtmp.bv_val : "" ); ch_free( vtmp.bv_val ); break; }