summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2022-01-25 16:57:09 +0200
committerTor Lillqvist <tml@collabora.com>2022-02-16 22:27:02 +0100
commit2b58a0979f9206cfca6d78cb2f3d5e65cd735f8b (patch)
tree36461fb175270caacbafd8cdd965d1beb6acdc8b /vcl
parent823eb92025853d120c17790d1c8efde59f033c69 (diff)
Add sanity check to avoid potential crash in the Collabora Online server
Make sure some coordinates don't become huge negative numbers. This doesn't fix the unknown root cause of course. There already was such a sanity check here in this branch, but for Android only. I now made it cross-platform. Let's use the same Change-Id as in the corresponding commit in the co-2021 branch. Change-Id: I28e343271b3f80ac203b52db1be58d2add89eecd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128932 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130051 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/window/layout.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index da259ec40c63..995ae09a0c9e 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -283,10 +283,11 @@ void VclBox::setAllocation(const Size &rAllocation)
// Though the dialogs are rendered in javascript for LOK Android some widgets like weld::DrawingArea
// is sent as bitmap but it is rendered from only the visible part
// when it gets negative, it shrinks instead of expands and it becomes invisible
-#if HAVE_FEATURE_ANDROID_LOK
if (nExtraSpace < 0)
+ {
+ SAL_WARN("vcl.layout", "nExtraSpace went negative, setting to zero");
nExtraSpace = 0;
-#endif
+ }
}
//Split into those we pack from the start onwards, and those we pack from the end backwards