Opened 9 years ago
Closed 5 years ago
#8735 closed Bugs (invalid)
boost::format crashes on "%0%" format string
Reported by: | Owned by: | James E. King, III | |
---|---|---|---|
Milestone: | To Be Determined | Component: | format |
Version: | Boost 1.51.0 | Severity: | Problem |
Keywords: | format | Cc: | oliora@… |
Description
Application crashes at runtime at the following code
boost::format("%0%") % "something";
I understand that 0 is a wrong format argument number (they are starting from 1), but it's too easy to forget about it (for example, Python uses 0 based format argument numbers). While boost::format is considered to be a safe alternative to printf, I think such mistakes should be handled and at least don't give a runtime crash.
Change History (2)
comment:1 by , 5 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Summary: | boost::format craches on "%0%" format string → boost::format crashes on "%0%" format string |
comment:2 by , 5 years ago
Resolution: | → invalid |
---|---|
Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
There is no crash in this case, but an unhandled exception which is the responsibility of the consuming application. I will add the following unit test anyway, but the report is invalid.