From 9e450558d89453bf5918b8a4e9265ad80063a2bc Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Tue, 3 Oct 2000 22:05:28 +0000 Subject: [PATCH] Fix add of empty value. --- clients/tools/ldapmodify.c | 10 ++++++++++ libraries/libldif/line64.c | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/clients/tools/ldapmodify.c b/clients/tools/ldapmodify.c index 59f2ce0911..2bb835a64e 100644 --- a/clients/tools/ldapmodify.c +++ b/clients/tools/ldapmodify.c @@ -1022,6 +1022,16 @@ domodify( fprintf( stderr, "%s: no attributes to change or add (entry=\"%s\")\n", prog, dn ); return( LDAP_PARAM_ERROR ); + } + + for ( i = 0; pmods[ i ] != NULL; ++i ) { + op = pmods[ i ]->mod_op & ~LDAP_MOD_BVALUES; + if( op == LDAP_MOD_ADD && ( pmods[i]->mod_bvalues == NULL )) { + fprintf( stderr, + "%s: attribute \"%s\" has no values (entry=\"%s\")\n", + prog, pmods[i]->mod_type, dn ); + return LDAP_PARAM_ERROR; + } } if ( verbose ) { diff --git a/libraries/libldif/line64.c b/libraries/libldif/line64.c index e101cd9e3e..947d35a616 100644 --- a/libraries/libldif/line64.c +++ b/libraries/libldif/line64.c @@ -116,7 +116,7 @@ ldif_parse_line( if ( *s == '\0' ) { /* no value */ - value = NULL; + value = ""; vlen = 0; goto done; } -- 2.39.5