View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000418 | Far Manager | _Common | public | 2007-12-06 01:42 | 2007-12-11 05:26 |
Reporter | alexmitin | Assigned To | vskirdin | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Fixed in Version | 1.80 alpha 1 | ||||
Summary | 0000418: Wrong memory copy function used in TArray<Object>::Pack() | ||||
Description | File: array.hpp Line: 159 Function: TArray<Object>::Pack() Context: template <class Object> bool TArray<Object>::Pack() { bool was_changed=false; for (unsigned int index=1; index<Count; ++index) { if(*items[index-1]==*items[index]) { deleteItem(index); was_changed=true; --Count; if(index<Count) { =[bug]==> memcpy(&items[index], &items[index+1], sizeof(Object*)*(Count-index)); --index; } } } return was_changed; } Analysis ========== The source and the destination buffer in a call to memcpy() are overlapping. In this case the memmove() function should be used. See the following links for more information about memcpy() and memmove(). http://msdn2.microsoft.com/en-us/library/dswaw1wk(VS.80).aspx http://msdn2.microsoft.com/en-us/library/8k35d1fx(VS.80).aspx | ||||
Additional Information | FAR 1.80.0.383. | ||||
Tags | No tags attached. | ||||
Build | 384 | ||||
Date Modified | Username | Field | Change |
---|---|---|---|
2007-12-06 01:42 | alexmitin | New Issue | |
2007-12-06 03:33 | vskirdin | Status | new => assigned |
2007-12-06 03:33 | vskirdin | Assigned To | => vskirdin |
2007-12-06 03:34 | vskirdin | Note Added: 0000961 | |
2007-12-06 03:34 | vskirdin | Status | assigned => feedback |
2007-12-10 22:53 | alexmitin | Status | feedback => resolved |
2007-12-10 22:53 | alexmitin | Resolution | open => fixed |
2007-12-10 22:53 | alexmitin | Note Added: 0000999 | |
2007-12-11 05:26 | vskirdin | Build | => 384 |
2007-12-11 05:26 | vskirdin | Status | resolved => closed |
2007-12-11 05:26 | vskirdin | Fixed in Version | => 1.80 alpha 1 |