VirtualBox

Changeset 46720 in vbox for trunk/include/VBox/settings.h


Ignore:
Timestamp:
Jun 21, 2013 10:07:31 AM (11 years ago)
Author:
vboxsync
Message:

Main/xml/Settings.cpp: limit snapshot depth to 250, avoiding crashes
Main/Snapshot: limit snapshot depth to 250
Main/Medium: eliminate some spurious error messages when saving a VM config

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/settings.h

    r46667 r46720  
    5050#include <list>
    5151#include <map>
     52
     53/**
     54 * Maximum depth of the snapshot tree, to prevent stack overflows.
     55 * XPCOM has a relatively low stack size for its workers, and we have
     56 * to avoid crashes due to exceeding the limit both on reading and
     57 * writing config files.
     58 */
     59#define SETTINGS_SNAPSHOT_DEPTH_MAX 250
    5260
    5361namespace xml
     
    11961204    void readAutostart(const xml::ElementNode *pElmAutostart, Autostart *pAutostart);
    11971205    void readGroups(const xml::ElementNode *elmGroups, StringsList *pllGroups);
    1198     void readSnapshot(const xml::ElementNode &elmSnapshot, Snapshot &snap);
     1206    void readSnapshot(uint32_t depth, const xml::ElementNode &elmSnapshot, Snapshot &snap);
    11991207    void convertOldOSType_pre1_5(com::Utf8Str &str);
    12001208    void readMachine(const xml::ElementNode &elmMachine);
     
    12091217    void buildAutostartXML(xml::ElementNode *pElmParent, const Autostart *pAutostart);
    12101218    void buildGroupsXML(xml::ElementNode *pElmParent, const StringsList *pllGroups);
    1211     void buildSnapshotXML(xml::ElementNode &elmParent, const Snapshot &snap);
     1219    void buildSnapshotXML(uint32_t depth, xml::ElementNode &elmParent, const Snapshot &snap);
    12121220
    12131221    void bumpSettingsVersionIfNeeded();
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