Re:Re: memory cruption problem
flxue2010
Thu Jul 24 14:58:01 2014
thanks for your reply,
the patch works in the current situation.
sorry for my bad description for the last mail by WEB HTML editor.
and as i'm not a native english speaker, some words i picked maynot correct and that makes you hard to understand.
sorry for that too.
At 2014-07-21 05:36:37, "Roy Marples" <roy@xxxxxxxxxxxx> wrote:
>On 2014-07-19 10:15, Roy Marples wrote:
>> Attached is a simpler patch which should fix your problem.
>> My testing time is limited today and I was unable to reproduce it
>> under valgrind so if you can test it and get back I'll commit it.
>
>It would help if I attached the patch.
>Here it is:
>
>--- compat/getline.c
>+++ compat/getline.c
>@@ -53,11 +53,11 @@
>
> bytes = 0;
> do {
> if (feof(fp))
> break;
>- if (*buf == NULL || bytes != 0) {
>+ if (*buf == NULL || bytes != 0 || *buflen < BUFSIZ) {
> newlen = *buflen + BUFSIZ;
> newbuf = realloc(*buf, newlen);
> if (newbuf == NULL)
> return -1;
> *buf = newbuf;
>
>
Archive administrator: postmaster@marples.name