When the pointer 'from' changes, it's stored length needs to change as
authorRichard Levitte <levitte@openssl.org>
Thu, 6 May 2004 09:33:22 +0000 (09:33 +0000)
committerRichard Levitte <levitte@openssl.org>
Thu, 6 May 2004 09:33:22 +0000 (09:33 +0000)
well.

Notified by Frank Kardel <kardel@acm.org> in PR 879.

crypto/conf/conf_def.c

index 0451be01538d1d2f26a9161bd6ebec3e2736e7fd..ba2a8830b44804037b36d53c91932a82826bb68b 100644 (file)
@@ -632,6 +632,11 @@ static int str_copy(CONF *conf, char *section, char **pto, char *from)
                        BUF_MEM_grow_clean(buf,(strlen(p)+buf->length-(e-from)));
                        while (*p)
                                buf->data[to++]= *(p++);
+
+                       /* Since we change the pointer 'from', we also have
+                          to change the perceived length of the string it
+                          points at.  /RL */
+                       len -= e-from;
                        from=e;
                        }
                else