Преглед на файлове

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
Rich Megginson преди 15 години
родител
ревизия
685cb4c361
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2 2
      ldap/servers/slapd/ldaputil.c

+ 2 - 2
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;