From 40468f0eb08ea8f83b23cceeeaf7f4beb3ba15ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Wed, 16 Oct 2024 21:18:20 +0100 Subject: [PATCH] cid#1606758 Overflowed constant MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ia1a3937159186b137b40036f1872d6156ebc0512 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175685 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- sc/source/core/tool/interpr1.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index 6a45d78aa655..84ee63f23b92 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -8752,6 +8752,11 @@ void ScInterpreter::ScSortBy() return; } pMatSrc->GetDimensions(nsC, nsR); + if (nsC == 0 || nsR == 0) + { + PushIllegalArgument(); + return; + } nSortCol2 = nsC - 1; // nSortCol1 = 0 nSortRow2 = nsR - 1; // nSortRow1 = 0 }