Anonymous | Login | 2022-06-26 01:37 UTC | ![]() |
My View | View Issues | Change Log | Roadmap |
View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0000091 | OMNeT++ | simulation kernel | public | 2009-07-31 17:32 | 2009-08-03 12:07 | ||||
Reporter | kosi | ||||||||
Assigned To | andras | ||||||||
Priority | normal | Severity | trivial | Reproducibility | always | ||||
Status | resolved | Resolution | fixed | ||||||
Platform | OS | OS Version | |||||||
Product Version | 4.0 | ||||||||
Target Version | Fixed in Version | 4.1 | |||||||
Summary | 0000091: cArray::clear() does not check for NULL | ||||||||
Description | In cArray, when you remove an object, the coresponding element of the array is set to NULL, but the clear method seems to assume that elements were only deleted from the end of the array. So if you create an array of at least two elements and delete an element other than the last you get a segfault: cArray arr; arr.add(new Message()); arr.add(new Message()); arr.remove(0); arr.clear(); //segfault here I've attached a fix for this problem which doesn't change the semantics of the add/remove operators. Another possible fix is to have the remove method swap the current object with the last object, though probably some code would break. | ||||||||
Tags | No tags attached. | ||||||||
Attached Files | ![]() | ||||||||
![]() |
|||
Date Modified | Username | Field | Change |
2009-07-31 17:32 | kosi | New Issue | |
2009-07-31 17:32 | kosi | File Added: carray.diff | |
2009-08-03 12:07 | andras | Note Added: 0000165 | |
2009-08-03 12:07 | andras | Status | new => resolved |
2009-08-03 12:07 | andras | Fixed in Version | => 4.1 |
2009-08-03 12:07 | andras | Resolution | open => fixed |
2009-08-03 12:07 | andras | Assigned To | => andras |
Copyright © 2000 - 2022 MantisBT Team |