VirtualBox

Changeset 28199 in vbox for trunk/src/VBox


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

IPRT: xml crash fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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