Opened 4 months ago

Closed 4 months ago

Last modified 4 months ago

#16163 closed defect (fixed)

wxHtmlHelpWindow::DoIndexFind crashes with 64 bit index search in wxArgNormalizer

Reported by: johnr Owned by: VZ
Priority: normal Milestone:
Component: GUI-all Version: dev-latest
Keywords: wxHtmlHelpWindow Index search Cc:
Blocked By: Blocking:
Patch: no

Description

With a 64 bit build wxHtmlHelpWindow::DoIndexFind size_t cnt is an unsigned_int64 and the following lines asserts in strvararg.h(45) with format specifier doesn't match argument type.

1692 cnttext.Printf(_("%i of %i"), displ, cnt);
Also
1730 cnttext.Printf(_("%i of %i"), cnt, cnt);

Change History (2)

comment:1 Changed 4 months ago by VZ

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

In 76285:

Don't use %i format specifier for size_t values.

In 64 bit build, size_t can be 64 bits while %i expects a 32 bit value.
Fix this by just avoiding the unnecessary use of size_t, the number of entries
in the index is not going to be greater than 232.

Closes #16163.

comment:2 Changed 4 months ago by VZ

In 76287:

Don't use %i format specifier for size_t values.

In 64 bit build, size_t can be 64 bits while %i expects a 32 bit value.
Fix this by just avoiding the unnecessary use of size_t, the number of entries
in the index is not going to be greater than 232.

Closes #16163.

Note: See TracTickets for help on using tickets.