diff options
author | Rich Megginson <rmeggins@redhat.com> | 2010-08-24 13:35:33 -0600 |
---|---|---|
committer | Rich Megginson <rmeggins@redhat.com> | 2010-08-31 13:35:55 -0600 |
commit | 685cb4c361452a26394c897ddaa0b6c2d8040e1d (patch) | |
tree | d488460d722f0ff694f0097fde7a5c2458dcad19 /ldap | |
parent | ef3d90459a0f43c8e3692cb7ea2cfafe73eb3ba9 (diff) | |
download | ds-685cb4c361452a26394c897ddaa0b6c2d8040e1d.tar.gz ds-685cb4c361452a26394c897ddaa0b6c2d8040e1d.tar.xz ds-685cb4c361452a26394c897ddaa0b6c2d8040e1d.zip |
check src < *out only; only check for \nspace if src < *out - 2
*out will never be NULL here, so we only need to check that src < *out as
the loop condition
when looking for a continuation line, make sure there are two characters
in *out to check
Diffstat (limited to 'ldap')
-rw-r--r-- | ldap/servers/slapd/ldaputil.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ldap/servers/slapd/ldaputil.c b/ldap/servers/slapd/ldaputil.c index d8fe13de..0aab901c 100644 --- a/ldap/servers/slapd/ldaputil.c +++ b/ldap/servers/slapd/ldaputil.c @@ -384,8 +384,8 @@ slapi_ldif_put_type_and_value_with_options( char **out, const char *t, const cha /* modify out in place, stripping out continuation lines */ char *src = save; char *dest = save; - for (; src && *src && (src != *out); ++src) { - if (!strncmp(src, "\n ", 2)) { + for (; src < *out; ++src) { + if ((src < (*out - 2)) && !strncmp(src, "\n ", 2)) { src += 2; /* skip continuation */ } *dest++ = *src; |