Issue 99526 - Using "up" to position salulation in mail merge wizard can place it out of range and crash
Summary: Using "up" to position salulation in mail merge wizard can place it out of ra...
Status: CLOSED FIXED
Alias: None
Product: Writer
Classification: Application
Component: code (show other issues)
Version: OOo 3.0.1
Hardware: All All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: h.ilter
QA Contact: issues@sw
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-23 11:56 UTC by caolanm
Modified: 2013-08-07 14:44 UTC (History)
1 user (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
patch to fix out of range in mailmerge wizard salutation move upwards (1.25 KB, patch)
2009-02-23 11:57 UTC, caolanm
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description caolanm 2009-02-23 11:56:37 UTC
If you press up more than 19 times in the mail merge wizard (e.g. 25 times) then
the salutation will be placed at a offset of -25 added to 19 in an unsigned
calculation, i.e. resulting in a massive 32bit number which is out of range of
the document, which may crash horribly.

Attached is a fix to the mailmerge wizard to only record successful up attempts
to clip it to the valid amount, and a patch to the MoveParagraph to fail on an
invalid up amount
Comment 1 caolanm 2009-02-23 11:57:07 UTC
Created attachment 60382 [details]
patch to fix out of range in mailmerge wizard salutation move upwards
Comment 2 caolanm 2009-02-23 12:06:25 UTC
for reference, here's the valgrind trace

==18035== Use of uninitialised value of size 4
==18035==    at 0x44C78C5: BigPtrArray::Index2Block(unsigned long) const
(bparr.cxx:199)
==18035==    by 0x44C78EF: BigPtrArray::operator[](unsigned long) const
(bparr.cxx:147)
==18035==    by 0x42D6C7A: SwDoc::MoveParagraph(SwPaM const&, long, unsigned
char) (ndarr.hxx:141)
==18035==    by 0x41A0A47: SwEditShell::MoveParagraph(long) (ednumber.cxx:388)
==18035==    by 0x12505930: SwMailMergeLayoutPage::InsertGreeting(SwWrtShell&,
SwMailMergeConfigItem&, bool) (mmlayoutpage.cxx:515)
==18035==    by 0x125073E2:
SwMailMergeLayoutPage::InsertAddressAndGreeting(SwView*, SwMailMergeConfigItem&,
Point const&, bool) (mmlayoutpage.cxx:306)
==18035==    by 0x125074A7:
SwMailMergeLayoutPage::commitPage(svt::WizardTypes::CommitPageReason)
(mmlayoutpage.cxx:278)
==18035==    by 0x65D44A2:
svt::OWizardMachine::prepareLeaveCurrentState(svt::WizardTypes::CommitPageReason) (in
/usr/lib/openoffice.org/basis3.0/program/libsvtli.so)
==18035==    by 0x65D48F7: svt::OWizardMachine::travelNext() (in
/usr/lib/openoffice.org/basis3.0/program/libsvtli.so)
==18035==    by 0x65D49AD: (within
/usr/lib/openoffice.org/basis3.0/program/libsvtli.so)
==18035==    by 0x60522BA: Control::ImplCallEventListenersAndHandler(unsigned
long, Link const&, void*) (in /usr/lib/openoffice.org/basis3.0/program/libvclli.so)
==18035==    by 0x604753D: Button::Click() (in
/usr/lib/openoffice.org/basis3.0/program/libvclli.so)
==18035==
==18035== Invalid read of size 4
==18035==    at 0x44C78C5: BigPtrArray::Index2Block(unsigned long) const
(bparr.cxx:199)
==18035==    by 0x44C78EF: BigPtrArray::operator[](unsigned long) const
(bparr.cxx:147)
==18035==    by 0x42D6C7A: SwDoc::MoveParagraph(SwPaM const&, long, unsigned
char) (ndarr.hxx:141)
==18035==    by 0x41A0A47: SwEditShell::MoveParagraph(long) (ednumber.cxx:388)
==18035==    by 0x12505930: SwMailMergeLayoutPage::InsertGreeting(SwWrtShell&,
SwMailMergeConfigItem&, bool) (mmlayoutpage.cxx:515)
==18035==    by 0x125073E2:
SwMailMergeLayoutPage::InsertAddressAndGreeting(SwView*, SwMailMergeConfigItem&,
Point const&, bool) (mmlayoutpage.cxx:306)
==18035==    by 0x125074A7:
SwMailMergeLayoutPage::commitPage(svt::WizardTypes::CommitPageReason)
(mmlayoutpage.cxx:278)
==18035==    by 0x65D44A2:
svt::OWizardMachine::prepareLeaveCurrentState(svt::WizardTypes::CommitPageReason) (in
/usr/lib/openoffice.org/basis3.0/program/libsvtli.so)
Comment 3 Mathias_Bauer 2009-04-14 13:16:05 UTC
Oliver, please take over
Comment 4 Oliver Specht 2009-04-15 08:40:46 UTC
Integrated into cws os130
Comment 5 Oliver Specht 2009-05-19 14:01:38 UTC
Reassigned for verification
Comment 6 h.ilter 2009-06-03 12:14:45 UTC
Verified with os130 without crash
Comment 7 h.ilter 2009-06-15 20:56:33 UTC
Also no Crash in cws os130a
Comment 8 amy2008 2009-07-20 04:17:36 UTC
Verified in DEV300m52
Closing
Comment 9 thorsten.ziehm 2009-07-20 15:34:40 UTC
Sorry this issue was wrongly closed. This issue will be reopened automatically.
And will be set after that back to fixed/verified.
Comment 10 thorsten.ziehm 2009-07-20 15:39:25 UTC
Set to state 'fixed'.
Comment 11 thorsten.ziehm 2009-07-20 15:43:49 UTC
Set back to state 'verified/fixed'.

Again. Sorry for the mass of mails.
Comment 12 caolanm 2009-08-13 11:53:58 UTC
closed, integrated m52