Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#889 closed defect (fixed)

new bugs from MSVC

Reported by: fdupont Owned by:
Priority: high Milestone:
Component: Unclassified Version:
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: Medium
Sub-Project: DNS Feature Depending on Ticket:
Estimated Difficulty: 0.0 Add Hours to Ticket: 0
Total Hours: 0 Internal?: no

Description (last modified by jinmei)

src/lib/cc/data.cc raises a bug with MSVC:

src/lib/config/tests (libcfgclient) raises another bug in data.h:

  • ListElement remove() (~ line 461) can be called with a bad argument, giving "vector erase iterator outside range". This is triggered by listRemove() (line ~ 67) in fake_session.cc. BTW, I don't understand this function...

I believe this one has been fixed in the master branch. (Trac #846)

Subtickets

Change History (5)

comment:1 Changed 9 years ago by jinmei

  • Description modified (diff)

comment:2 in reply to: ↑ description Changed 9 years ago by fdupont

Replying to fdupont:

src/lib/cc/data.cc raises a bug with MSVC:

src/lib/config/tests (libcfgclient) raises another bug in data.h:

  • ListElement remove() (~ line 461) can be called with a bad argument, giving "vector erase iterator outside range". This is triggered by listRemove() (line ~ 67) in fake_session.cc. BTW, I don't understand this function...

I believe this one has been fixed in the master branch. (Trac #846)

=> I took the trac826 branch from master this Sunday... but the code seems to be correct now in
master, thanks.

comment:3 Changed 9 years ago by jreed

  • Defect Severity changed from High to Medium

comment:4 Changed 9 years ago by shane

  • Milestone New Tasks deleted
  • Resolution set to fixed
  • Status changed from new to closed

comment:5 Changed 9 years ago by fdupont

Please reopen it: there were two bugs, only the second was fixed.
With the correct description and only the first bug:

src/lib/cc/data.cc raises a bug with MSVC:

  • in removeIdentical() (the first one ~ line 851) I get a "map/set iterator not incrementable". Reading the code an iterator "it" is built from std::map and ++ is called on it even when it can point to end after the remove if it points to the last element...

BTW the standard way is to have remove() returning the iterator so you can write
if () { it = remove(); } else ++it;

Note: See TracTickets for help on using tickets.