mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-26 19:33:31 +00:00
[FASTFAT] Copy an entire field, instead of half-copying it with RtlCopyMemory
Fixes GCC 8 warning:
sdk/include/crt/mingw32/intrin_x86.h:76:12: error: 'memmove' offset [21, 40] from the object at 'DirContext' is out of the bounds of referenced subobject 'Attrib' with type 'unsigned char' at offset 19 [-Werror=array-bounds]
return memmove(dest, source, num);
^~~~~~~~~~~~~~~~~~~~~~~~~~
This commit is contained in:
@@ -806,11 +806,9 @@ FATAddEntry(
|
||||
{
|
||||
RtlZeroMemory(pFatEntry, DeviceExt->FatInfo.BytesPerCluster);
|
||||
/* create '.' and '..' */
|
||||
RtlCopyMemory(&pFatEntry[0].Attrib, &DirContext.DirEntry.Fat.Attrib,
|
||||
sizeof(FAT_DIR_ENTRY) - FIELD_OFFSET(FAT_DIR_ENTRY, Attrib));
|
||||
pFatEntry[0] = DirContext.DirEntry.Fat;
|
||||
RtlCopyMemory(pFatEntry[0].ShortName, ". ", 11);
|
||||
RtlCopyMemory(&pFatEntry[1].Attrib, &DirContext.DirEntry.Fat.Attrib,
|
||||
sizeof(FAT_DIR_ENTRY) - FIELD_OFFSET(FAT_DIR_ENTRY, Attrib));
|
||||
pFatEntry[1] = DirContext.DirEntry.Fat;
|
||||
RtlCopyMemory(pFatEntry[1].ShortName, ".. ", 11);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user