View Issue Details

IDProjectCategoryView StatusLast Update
0000418Far Manager_Commonpublic2007-12-11 05:26
Reporteralexmitin Assigned Tovskirdin  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Fixed in Version1.80 alpha 1 
Summary0000418: Wrong memory copy function used in TArray<Object>::Pack()
DescriptionFile: 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 InformationFAR 1.80.0.383.
TagsNo tags attached.
Build384

Activities

vskirdin

2007-12-06 03:34

administrator   bugnote:0000961

после 384

alexmitin

2007-12-10 22:53

reporter   bugnote:0000999

Fix verified.

Issue History

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