Opened 12 years ago

Closed 12 years ago

#11014 closed defect (fixed)

Fix for crash in wxURLDataObject::SetURL

Reported by: botg Owned by:
Priority: normal Milestone:
Component: wxMSW Version: oldstable-latest
Keywords: Cc:
Blocked By: Blocking:
Patch: yes


The attached patch fixes a crash in wxURLDataObject::SetURL in wxWidges 2.8

The function does not check the return value of wxString::mbc_str(). As result it crashes when calling strlen with a null pointer if the conversion fails. (e.g. Chinese characters on a system with German locale settings)

Only 2.8 branch is affected, trunk properly checks for nullpointer.

Attachments (1)

dataobj.cpp.patch download (663 bytes) - added by botg 12 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 12 years ago by botg

This bug has originally been reported at

Changed 12 years ago by botg

comment:2 Changed 12 years ago by vadz

I guess the real fix would be to use Unicode for the URL on the clipboard but this might be not completely trivial (if my comment about CFSTR_SHELLURL always using ANSI is correct, at least) so for now I'll just apply your patch to at least fix the crash.

Thanks a lot for this fix!

comment:3 Changed 12 years ago by VZ

  • Resolution set to fixed
  • Status changed from new to closed

(In [61506]) Fix crash when copying Unicode URLs to the clipboard.

Closes #11014.

comment:4 Changed 12 years ago by botg

  • Resolution fixed deleted
  • Status changed from closed to reopened

Unfortunately the patch has not been applied correctly in [61506], it checks for

if ( url )

whereas it should check against

if ( urlA )

comment:5 Changed 12 years ago by vadz

  • Resolution set to fixed
  • Status changed from reopened to closed

Sorry about this and thanks for noticing it, corrected now in r61661.

Note: See TracTickets for help on using tickets.