List Info

Thread: Re: session_file fix




Re: session_file fix
user name
2008-03-04 11:36:53
How to reproduce this.

On 3/4/08, Gisle Vanem <gvanembroadpark.no> wrote:
> I discovered another problem; the djgpp version crashed
in free() due to
> 'doc.address' having a random value. Fix by clearing
the 'doc' structure
> first:
>
> --- orig/src/LYSession.c        Sun Feb 17 21:00:58
2008
> +++ src/LYSession.c     Tue Mar 04 15:39:29 2008
>  -123,6 +123,7 
>                         *value1++ = 0;
>                     if ((value2 = strchr(value1, 't'))
!= 0) {
>                         *value2++ = 0;
> +                       memset(&doc, 0,
sizeof(doc));
>                         doc.line = atoi(rsline);
>                         doc.link = atoi(linktext);
>                         StrAllocCopy(doc.address,
value1);
>
> --gv
>
>
> _______________________________________________
> Lynx-dev mailing list
> Lynx-devnongnu.org
> htt
p://lists.nongnu.org/mailman/listinfo/lynx-dev
>


_______________________________________________
Lynx-dev mailing list
Lynx-devnongnu.org
htt
p://lists.nongnu.org/mailman/listinfo/lynx-dev

Re: session_file fix
country flaguser name
Norway
2008-03-04 12:03:58
"Paul B. Mahol" <onemdagmail.com> wrote:

> How to reproduce this.

I ran "lynx -session=foo" and produced some links
in 'foo'.
Then exit and ran the same command again. Then
RestoreSession()
caused a crash in free().

--gv


_______________________________________________
Lynx-dev mailing list
Lynx-devnongnu.org
htt
p://lists.nongnu.org/mailman/listinfo/lynx-dev

Re: session_file fix
country flaguser name
United States
2008-03-04 14:15:06
On Tue, 4 Mar 2008, Paul B. Mahol wrote:

> How to reproduce this.

Linux malloc clears memory just like calloc.  It's easy to
overlook
uninitialized memory from malloc's in that situation.

>
> On 3/4/08, Gisle Vanem <gvanembroadpark.no> wrote:
>> I discovered another problem; the djgpp version
crashed in free() due to
>> 'doc.address' having a random value. Fix by
clearing the 'doc' structure
>> first:
>>
>> --- orig/src/LYSession.c        Sun Feb 17 21:00:58
2008
>> +++ src/LYSession.c     Tue Mar 04 15:39:29 2008
>>  -123,6 +123,7 
>>                         *value1++ = 0;
>>                     if ((value2 = strchr(value1,
't')) != 0) {
>>                         *value2++ = 0;
>> +                       memset(&doc, 0,
sizeof(doc));
>>                         doc.line = atoi(rsline);
>>                         doc.link = atoi(linktext);
>>                         StrAllocCopy(doc.address,
value1);
>>
>> --gv
>>
>>
>> _______________________________________________
>> Lynx-dev mailing list
>> Lynx-devnongnu.org
>> htt
p://lists.nongnu.org/mailman/listinfo/lynx-dev
>>
>
>
> _______________________________________________
> Lynx-dev mailing list
> Lynx-devnongnu.org
> htt
p://lists.nongnu.org/mailman/listinfo/lynx-dev
>

-- 
Thomas E. Dickey
http://invisible-island.n
et
ftp://invisible-island.net


_______________________________________________
Lynx-dev mailing list
Lynx-devnongnu.org
htt
p://lists.nongnu.org/mailman/listinfo/lynx-dev

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )