From 54f5e44f580aa3eb8c498f27049f0f7e92ba2ffe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Wed, 16 Oct 2024 21:15:50 +0100 Subject: [PATCH] cid#1606697 silence Overflowed constant MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I81d0b10f8e0c34f9d276e59b5eed2c3d879f05cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176195 Reviewed-by: Caolán McNamara Tested-by: Jenkins --- tools/source/fsys/urlobj.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx index 5e200867a5cc..84a89cd32808 100644 --- a/tools/source/fsys/urlobj.cxx +++ b/tools/source/fsys/urlobj.cxx @@ -2656,6 +2656,7 @@ bool INetURLObject::parseHost(sal_Unicode const *& rBegin, sal_Unicode const * p } else if (rtl::isAsciiHexDigit(*p) && nDigits < 4) { + assert(nNumber < 0xffff); nNumber = 16 * nNumber + INetMIME::getHexWeight(*p); ++nDigits; } @@ -2719,6 +2720,7 @@ bool INetURLObject::parseHost(sal_Unicode const *& rBegin, sal_Unicode const * p } else if (rtl::isAsciiDigit(*p) && nDigits < 3) { + assert(nNumber < 0xfff); nNumber = 16 * nNumber + INetMIME::getWeight(*p); ++nDigits; } @@ -2752,6 +2754,7 @@ bool INetURLObject::parseHost(sal_Unicode const *& rBegin, sal_Unicode const * p } else if (rtl::isAsciiHexDigit(*p) && nDigits < 4) { + assert(nNumber < 0xffff); nNumber = 16 * nNumber + INetMIME::getHexWeight(*p); ++nDigits; } @@ -2809,6 +2812,7 @@ bool INetURLObject::parseHost(sal_Unicode const *& rBegin, sal_Unicode const * p } else if (rtl::isAsciiDigit(*p) && nDigits < 3) { + assert(nNumber < 0xfff); nNumber = 16 * nNumber + INetMIME::getWeight(*p); ++nDigits; }