Hi,
On Sat, Jul 16, 2011 at 6:57 PM, Volodymyr Rudyj
<vladimir.rudoy@gmail.com> wrote:
>
> Good day !
>
> I need help and little code review. I`m working on improving HTML
> exporter (as you know, I`m using it in EPUB plugin). And while
> exporting some of the documents to HTML (and as a result to EPUB),
> e.g. abiword build instructions, assertion occurs which says that we
> tried to access element of the UT_vector by index which is out of
> range. I`ve found out that the reason is pf_Frag_Strux::getFmtHandle
> method. You can see stack trace at http://pastebin.com/nc6LSPe8 . So
> here is a little patch that fixes the problem. So what do you think
> about this patch?
>
> Thanks!
>
> ### Eclipse Workspace Patch 1.0
> #P abiword
> Index: src/text/ptbl/xp/pf_Frag_Strux.cpp
> ===================================================================
> --- src/text/ptbl/xp/pf_Frag_Strux.cpp (revision 30045)
> +++ src/text/ptbl/xp/pf_Frag_Strux.cpp (working copy)
> @@ -55,7 +55,7 @@
>
> PL_StruxFmtHandle pf_Frag_Strux::getFmtHandle(PL_ListenerId lid) const
> {
> - if (m_vecFmtHandle.size() == 0) return 0;
> + if ((m_vecFmtHandle.size() == 0) || (lid >= m_vecFmtHandle.size())) return 0;
> return (PL_StruxFmtHandle)m_vecFmtHandle.getNthItem(lid);
> }
>
According to uwog, the number of formathandles is less than or equal
to the number of listeners, and it is not always equal. So I'm +1 for
this patch.
BTW, this is for http://bugzilla.abisource.com/show_bug.cgi?id=13088
-- Thanks & regards Xun SunReceived on Sat Jul 16 16:29:47 2011
This archive was generated by hypermail 2.1.8 : Sat Jul 16 2011 - 16:29:47 CEST