ICU-8273 Add check to avoid memcpy from and to the same address.
X-SVN-Rev: 29299
This commit is contained in:
parent
7c0b4a6d90
commit
2daf3b0175
@ -1,6 +1,6 @@
|
||||
/*
|
||||
**********************************************************************
|
||||
* Copyright (C) 2008-2010, International Business Machines
|
||||
* Copyright (C) 2008-2011, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
**********************************************************************
|
||||
*/
|
||||
@ -952,7 +952,10 @@ uspoof_swap(const UDataSwapper *ds, const void *inData, int32_t length, void *ou
|
||||
//
|
||||
uint32_t magic = ds->readUInt32(spoofDH->fMagic);
|
||||
ds->writeUInt32((uint32_t *)&outputDH->fMagic, magic);
|
||||
uprv_memcpy(outputDH->fFormatVersion, spoofDH->fFormatVersion, sizeof(spoofDH->fFormatVersion));
|
||||
|
||||
if (outputDH->fFormatVersion != spoofDH->fFormatVersion) {
|
||||
uprv_memcpy(outputDH->fFormatVersion, spoofDH->fFormatVersion, sizeof(spoofDH->fFormatVersion));
|
||||
}
|
||||
// swap starting at fLength
|
||||
ds->swapArray32(ds, &spoofDH->fLength, sizeof(SpoofDataHeader)-8 /* minus magic and fFormatVersion[4] */, &outputDH->fLength, status);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user