Ticket #13648 (closed defect: outdated)

Opened 19 months ago

Last modified 19 months ago

Fix segfault in wxUIntProperty calling wxString::Format with wrong fmt

Reported by: jrl1 Owned by:
Priority: normal Milestone:
Component: wxPropertyGrid Version: 2.9-svn
Keywords: Cc:
Blocked By: Patch: no
Blocking:

Description

wxUIntProperty::ValueToString() does not take into account that long can be 32 or 64 bits and so it needs to use a different wxString::Format() depending on the sizeof(long).

Without this patch wxUIntProperties segfault and are unusable on 64 bit linux w/ gcc.

The one line patch was made using this command in the root wxWidgets checkout dir.
$svn diff > wxuintproperty_string_format_patch.patch

Attachments

wxuintproperty_string_format_patch.patch download (0.5 KB) - added by jrl1 19 months ago.
svn diff > a.patch in root wxWidgets dir.

Change History

Changed 19 months ago by jrl1

svn diff > a.patch in root wxWidgets dir.

Changed 19 months ago by vadz

  • priority changed from high to normal
  • status changed from new to infoneeded_new
  • patch unset
  • milestone deleted

I don't believe this patch is correct, or at least its explanation isn't. On 64 bit systems using "%ld" (or "%lu", "%lx" &c) is absolutely the right thing to do for long values and printing them should work regardless of the exact size.

So what exactly is the problem and why does it crash?

Changed 19 months ago by jrl1

  • status changed from infoneeded_new to closed
  • resolution set to outdated

I didn't notice that you had fixed the problem elsewhere since the code around my fix looked the same when I pasted my fix back in to make the patch.

 http://svn.wxwidgets.org/viewvc/wx/wxWidgets/trunk/src/propgrid/props.cpp?view=log

 http://svn.wxwidgets.org/viewvc/wx/wxWidgets/trunk/src/propgrid/props.cpp?r1=66728&r2=69113

Sorry about the trouble.

Note: See TracTickets for help on using tickets.