VirtualBox

Changeset 28199 in vbox


Ignore:
Timestamp:
Apr 12, 2010 12:20:33 PM (15 years ago)
Author:
vboxsync
Message:

IPRT: xml crash fix

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/cpp/xml.h

    r28164 r28199  
    455455    int getLineNumber() const;
    456456
    457     int isElement()
     457    int isElement() const
    458458    {
    459459        return m_Type == IsElement;
  • trunk/src/VBox/Runtime/r3/xml.cpp

    r28164 r28199  
    494494}
    495495
     496/**
     497 * Returns the name of the node, which is either the element name or
     498 * the attribute name. For other node types it probably returns NULL.
     499 * @return
     500 */
    496501const char* Node::getName() const
    497502{
     
    664669{
    665670    int i = 0;
    666     Data::InternalNodesList::const_iterator
    667         it,
    668         last = m->children.end();
    669     for (it = m->children.begin();
    670          it != last;
     671    for (Data::InternalNodesList::iterator it = m->children.begin();
     672         it != m->children.end();
    671673         ++it)
    672674    {
    673675        // export this child node if ...
    674         if (    (!pcszMatch)    // the caller wants all nodes or
    675              || (!strcmp(pcszMatch, (**it).getName())) // the element name matches
    676            )
    677         {
    678             Node *pNode = (*it).get();
    679             if (pNode->isElement())
    680                 children.push_back(static_cast<ElementNode*>(pNode));
    681             ++i;
    682         }
     676        Node *p = it->get();
     677        if (p->isElement())
     678            if (    (!pcszMatch)    // the caller wants all nodes or
     679                 || (!strcmp(pcszMatch, p->getName())) // the element name matches
     680               )
     681            {
     682                children.push_back(static_cast<ElementNode*>(p));
     683                ++i;
     684            }
    683685    }
    684686    return i;
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