VirtualBox

Changeset 79673 in vbox for trunk


Ignore:
Timestamp:
Jul 10, 2019 1:24:48 PM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9491. Limiting size of the loaded data during log file reads.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.cpp

    r79365 r79673  
    5050#include "CSystemProperties.h"
    5151
     52const ULONG uAllowedLogSize = _256M;
    5253UIVMLogViewerWidget::UIVMLogViewerWidget(EmbedTo enmEmbedding,
    5354                                         UIActionPool *pActionPool,
     
    817818                strText.append(QString::fromUtf8((char*)data.data(), data.size()));
    818819                uOffset += data.size();
     820                /* Don't read futher if we have reached the allowed size limit: */
     821                if (uOffset >= uAllowedLogSize)
     822                {
     823                    strText.append("\n=========Log file has been truncate as it is too large.======");
     824                    break;
     825                }
    819826            }
    820827            /* Anything read at all? */
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