Patch #507
closed
Diverse Bugfixes von Per Inge Mathisen
Added by Marco Eichelberg over 12 years ago.
Updated about 12 years ago.
Description
The attached patch fixes various issues found by running latest version
of cppcheck over dcmtk git master. Note that I have not tested these
changes, apart from running them through you unit tests
Concerning the last change - it is apparently a very bad idea to throw
an exception from a destructor, and cppcheck considers it an error.
More fixes after running static analysis on your software.
ofstringoffbyone.diff - fixes a few off-by-one errors in your fallback
implementation of std::string. After skimming through that code, I think
I would recommend that you retire it and rely on working std::string
implementations instead.
misc.diff - various places where pointers could be dereferenced while
NULL
Files
- Tracker changed from Bug to Patch
- Category set to Library
- Target version set to 3.6.2
- Priority changed from Normal to High
- Assignee set to Uli Schlachter
- Status changed from New to Feedback
- Assignee deleted (
Uli Schlachter)
- % Done changed from 0 to 90
ofstringoffbyone.diff: NAK, reserve(n) makes sure there is an array of size at least (n+1), so this already makes sure that there is space for the EOS mark (and AFAIR this is the behavior that the C++ standard requires).
misc.diff: I don't like the "else {" > "else if (last) {" change. This can never make a difference, because "last" and "handle_>findRequestList" are both set in the same line. If this ever happens (remember, it cannot happen), a crash is IMHO better than silently forgetting (and leaking) parts of the request and generating a wrong reply. No one wants to debug that.
The "throw exception from destructor"-problem is reported to log4cplus.
All the other changes are part of commit a5fdfd28ccd1f067676abd6cebb70cac911709b0.
Someone should write a "thank you" mail with the above comments and a link to the commit in gitweb to Per...
Wrote that thank you email :)
- Status changed from Feedback to Closed
Also available in: Atom
PDF