VirtualBox

Changeset 29893 in vbox


Ignore:
Timestamp:
May 31, 2010 10:37:17 AM (15 years ago)
Author:
vboxsync
Message:

OVFReader: fix another type lookup regression on OVF 0.9 import

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/xml/ovfreader.cpp

    r29876 r29893  
    297297    {
    298298        const char *pcszElemName = pelmThis->getName();
    299         const xml::AttributeNode *pTypeAttr = pelmThis->findAttribute("type");
    300         const char *pcszTypeAttr = (pTypeAttr) ? pTypeAttr->getValue() : "";
     299        const char *pcszTypeAttr = "";
     300        if (!strcmp(pcszElemName, "Section"))       // OVF 0.9 used "Section" element always with a varying "type" attribute
     301        {
     302            const xml::AttributeNode *pTypeAttr;
     303            if (    ((pTypeAttr = pelmThis->findAttribute("type")))
     304                 || ((pTypeAttr = pelmThis->findAttribute("xsi:type")))
     305               )
     306                pcszTypeAttr = pTypeAttr->getValue();
     307            else
     308                throw OVFLogicError(N_("Error reading \"%s\": element \"Section\" has no \"type\" attribute, line %d"),
     309                                    m_strPath.c_str(),
     310                                    pelmThis->getLineNumber());
     311        }
    301312
    302313        if (    (!strcmp(pcszElemName, "EulaSection"))
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