From: Howard Chu Date: Tue, 28 Jul 2009 22:04:13 +0000 (+0000) Subject: ITS#6233 don't advance ptr after storing final NUL. X-Git-Tag: ACLCHECK_0~393 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=82874bed6ef1c1d6ff7e3ae05fb4786a35fc58fa;p=openldap ITS#6233 don't advance ptr after storing final NUL. --- diff --git a/clients/tools/common.c b/clients/tools/common.c index 5185a699da..8ac059fcbd 100644 --- a/clients/tools/common.c +++ b/clients/tools/common.c @@ -2073,7 +2073,7 @@ print_deref( LDAP *ld, LDAPControl *ctrl ) } ptr = lutil_strncopy( ptr, dr->derefVal.bv_val, dr->derefVal.bv_len ); *ptr++ = '\n'; - *ptr++ = '\0'; + *ptr = '\0'; assert( ptr <= buf + len ); tool_write_ldif( LDIF_PUT_COMMENT, NULL, buf, ptr - buf);