VirtualBox

Changeset 70298 in vbox for trunk/src


Ignore:
Timestamp:
Dec 22, 2017 1:51:33 AM (7 years ago)
Author:
vboxsync
Message:

VDVfs.cpp: Fixed bug in vdReadHelper when handling unaligned reads, ended up with negative size. Just rewrote it a little bit. Applied the same fixes to vdWriteHelper. [bugfix]

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Storage/VDVfs.cpp

    r70297 r70298  
    113113            Assert(cbRead < 512);
    114114            Assert(!(off % 512));
     115            Assert(cbMisalign > 0);
    115116
    116117            rc = VDRead(pDisk, off, abBuf, 512);
     
    185186        /* Unaligned buffered read+write of tail. */
    186187        if (   RT_SUCCESS(rc)
    187             && cbMisalign)
    188         {
     188            && cbWrite > 0)
     189        {
     190            Assert(cbMisalign > 0);
    189191            Assert(cbWrite < 512);
    190192            Assert(!(off % 512));
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette