Re: Patch: 2633

From: Dom Lachowicz <domlachowicz_at_yahoo.com>
Date: Sun Sep 12 2004 - 15:58:13 CEST

Robert,

Patch approved. Nice work!

Dom

--- Robert Wilhelm <robert.wilhelm@gmx.net> wrote:

>
> By guarding against several null pointer accesses of
> ps->lfo in
> wv/pap.c,
> I can load the second file (abi2_test.doc) in bug
> 2633.
>
> Dom, please have a look at this.
>
> Robert
> > Index: pap.c
>
===================================================================
> RCS file: /cvsroot/wv/pap.c,v
> retrieving revision 1.33
> diff -u -r1.33 pap.c
> --- pap.c 28 May 2003 13:41:25 -0000 1.33
> +++ pap.c 12 Sep 2004 05:56:28 -0000
> @@ -354,7 +354,8 @@
> wvTrace(("list: ilvl %d, ilfo
> %d\n",apap->ilvl,apap->ilfo)); /* ilvl is the list
> level */
>
> /* first, get the LFO, and then find the lfovl for
> this paragraph */
> - myLFO = &ps->lfo[apap->ilfo - 1];
> + if (ps->lfo)
> + myLFO = &ps->lfo[apap->ilfo - 1];
>
> while(i < (S32)apap->ilfo - 1 && i <
> (S32)ps->nolfo)
> {
> @@ -363,7 +364,10 @@
> }
>
> /* remember how many overrides are there for this
> record */
> - k = ps->lfo[i].clfolvl;
> + if (ps->lfo)
> + k = ps->lfo[i].clfolvl;
> + else
> + k = 0;
>
> /* if there are any overrides, then see if one of
> them applies to this level */
> if(k && ps->lfolvl)
> @@ -454,7 +458,7 @@
> {
> prevLVL = myLVL;
> prevLVLF = myLVLF;
> - myListId = myLFO->lsid;
> + myListId = myLFO ? myLFO->lsid : 0;
> wvTrace(("list: using the LVL from LST\n"));
> i = 0;
>
>

                
_______________________________
Do you Yahoo!?
Shop for Back-to-School deals on Yahoo! Shopping.
http://shopping.yahoo.com/backtoschool
Received on Sun Sep 12 15:58:23 2004

This archive was generated by hypermail 2.1.8 : Sun Sep 12 2004 - 15:58:23 CEST