Project

General

Profile

Actions

Patch #507

closed

Diverse Bugfixes von Per Inge Mathisen

Added by Marco Eichelberg over 12 years ago. Updated about 12 years ago.

Status:
Closed
Priority:
High
Assignee:
-
Category:
Library
Target version:
Start date:
2013-03-05
Due date:
% Done:

90%

Estimated time:
Module:
Operating System:
Compiler:

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

cppcheckfixes.diff (4.88 KB) cppcheckfixes.diff Marco Eichelberg, 2013-03-05 09:42
misc.diff (1.8 KB) misc.diff Marco Eichelberg, 2013-03-05 09:42
ofstringoffbyone.diff (1.07 KB) ofstringoffbyone.diff Marco Eichelberg, 2013-03-05 09:42
Actions #1

Updated by Marco Eichelberg over 12 years ago

  • Tracker changed from Bug to Patch
Actions #2

Updated by Jörg Riesmeier over 12 years ago

  • Category set to Library
  • Target version set to 3.6.2
Actions #3

Updated by Jörg Riesmeier over 12 years ago

  • Priority changed from Normal to High
Actions #4

Updated by Jörg Riesmeier over 12 years ago

  • Assignee set to Uli Schlachter
Actions #5

Updated by Uli Schlachter over 12 years ago

  • 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...

Actions #6

Updated by Uli Schlachter over 12 years ago

Half of the change to oflog was applied to log4cplus: https://sourceforge.net/p/log4cplus/bugs/162/

Actions #7

Updated by Michael Onken about 12 years ago

Wrote that thank you email :)

Actions #8

Updated by Michael Onken about 12 years ago

  • Status changed from Feedback to Closed
Actions

Also available in: Atom PDF