From 2ec6326d776a02ae521b2ad440884961bb889c99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20G=C3=A2teau?= Date: Tue, 22 Dec 2009 17:28:22 +0000 Subject: [PATCH] Do not allow backgrounds whose width or height is more than 100000 pixels svn path=/trunk/KDE/kdelibs/; revision=1065178 --- framesvg.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/framesvg.cpp b/framesvg.cpp index 722d9da57..e46b39ccf 100644 --- a/framesvg.cpp +++ b/framesvg.cpp @@ -36,6 +36,10 @@ namespace Plasma { +// Any attempt to generate a frame whose width or height is larger than this +// will be rejected +static const int MAX_FRAME_SIZE = 100000; + FrameSvg::FrameSvg(QObject *parent) : Svg(parent), d(new FrameSvgPrivate(this)) @@ -491,6 +495,10 @@ void FrameSvgPrivate::generateFrameBackground(FrameData *frame) kWarning() << "Invalid frame size" << size; return; } + if (size.width() >= MAX_FRAME_SIZE || size.height() >= MAX_FRAME_SIZE) { + kWarning() << "Not generating frame background for a size whose width or height is more than" << MAX_FRAME_SIZE << size; + return; + } const int contentWidth = size.width() - frame->leftWidth - frame->rightWidth; const int contentHeight = size.height() - frame->topHeight - frame->bottomHeight;