VirtualBox

Changeset 37246 in vbox for trunk/src/VBox/Storage/VMDK.cpp


Ignore:
Timestamp:
May 30, 2011 8:33:24 AM (14 years ago)
Author:
vboxsync
Message:

Storage/VMDK+VDI: fix error handling when pointing to a zero size file

File:
1 edited

Legend:

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

    r37100 r37246  
    55
    66/*
    7  * Copyright (C) 2006-2010 Oracle Corporation
     7 * Copyright (C) 2006-2011 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    27042704    if (RT_FAILURE(rc))
    27052705    {
    2706         rc = vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: error reading extent header in '%s'"), pExtent->pszFullname);
     2706        vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: error reading extent header in '%s'"), pExtent->pszFullname);
     2707        rc = VERR_VD_VMDK_INVALID_HEADER;
    27072708        goto out;
    27082709    }
     
    27422743        if (RT_FAILURE(rc))
    27432744        {
    2744             rc = vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: error reading extent footer in '%s'"), pExtent->pszFullname);
     2745            vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: error reading extent footer in '%s'"), pExtent->pszFullname);
     2746            rc = VERR_VD_VMDK_INVALID_HEADER;
    27452747            goto out;
    27462748        }
     
    30253027    AssertRC(rc);
    30263028    if (RT_FAILURE(rc))
    3027         goto out;
     3029    {
     3030        vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: error reading ESX sparse extent header in '%s'"), pExtent->pszFullname);
     3031        rc = VERR_VD_VMDK_INVALID_HEADER;
     3032        goto out;
     3033    }
    30283034    if (    RT_LE2H_U32(Header.magicNumber) != VMDK_ESX_SPARSE_MAGICNUMBER
    30293035        ||  RT_LE2H_U32(Header.version) != 1
     
    32403246    if (RT_FAILURE(rc))
    32413247    {
    3242         rc = vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: error reading the magic number in '%s'"), pImage->pszFilename);
     3248        vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: error reading the magic number in '%s'"), pImage->pszFilename);
     3249        rc = VERR_VD_VMDK_INVALID_HEADER;
    32433250        goto out;
    32443251    }
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