possible fix for bidi build crashing on startup (not Win32 specific)


Subject: possible fix for bidi build crashing on startup (not Win32 specific)
From: Kenneth J.Davis (jeremyd@computer.org)
Date: Sun Jan 13 2002 - 00:51:42 CST


Hello all,

As you may have ignored, I have been trying to figure out
why the bidi build dies for me under Windows (2000, XP(RC2)
and reported 98). After looking through assembly of it
running, I ended up right back to where I started, fribidi.

Basically, AbiWord calls fribidi_log2vis with string & length,
which calls fribidi_analyse_string with string & length.
fribidi_analyse_string makes a copy of string and then calls
run_length_encode_types with the copy and length. Well
run_length_encode_types and later in fribidi_analyse_string,
there are for loops that loop from 0 to len instead of
0 to (len-1), which results in access to 1 past the end
of the string passed in and its copy.

My patch changes these to for loops from 0 to (len-1), but
this may not be correct, as I didn't check (other than
seeing if AbiWord builds & runs) if fribidi really relies
on the one past. Please either apply asis or make the
appropriate changes to fribidi. Note: I either messed
something up in my changes to get current fribidi to
build under VC5 or it doesn't fix both of these places,
so when/if fribidi is updated, these need to be check for
again.

The second patch attached is purely to remove warnings.
I don't really care if its applied, or an alternate (changing
both places to use class) is applied, but mixing struct
and class just seems bad to me.

Jeremy Davis
jeremyd@computer.org





This archive was generated by hypermail 2b25 : Sun Jan 13 2002 - 01:07:11 CST