浏览代码

ber_printf 'o' cannot handle NULL bv_val

The value passed to the char * argument to ber_printf 'o' must not be
a NULL, even if the bv_len argument is 0.  An empty string "" must
be passed instead.
Rich Megginson 15 年之前
父节点
当前提交
b5431929ad
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      ldap/servers/slapd/result.c

+ 2 - 2
ldap/servers/slapd/result.c

@@ -240,7 +240,7 @@ check_and_send_extended_result(Slapi_PBlock *pb, ber_tag_t tag, BerElement *ber)
 		if (rc != LBER_ERROR && exop_value != NULL) {
 			rc = ber_printf( ber, "to",
 			    LDAP_TAG_EXOP_RES_VALUE,
-			    exop_value->bv_val,
+			    exop_value->bv_val ? exop_value->bv_val : "",
 			    exop_value->bv_len );
 		}
 	}
@@ -263,7 +263,7 @@ check_and_send_SASL_response(Slapi_PBlock *pb, ber_tag_t tag, BerElement *ber, C
 		if ( bind_ret_saslcreds != NULL ) {
 			rc = ber_printf( ber, "to",
 			    LDAP_TAG_SASL_RES_CREDS,
-			    bind_ret_saslcreds->bv_val,
+			    bind_ret_saslcreds->bv_val ? bind_ret_saslcreds->bv_val : "",
 			    bind_ret_saslcreds->bv_len );
 		}
 	}