From bea8576e8218cc8fee7966877d7412377e70e204 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 1 May 2024 20:19:24 +0100 Subject: cid#1596706 Dereference after null check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: If7156d9b0aaa392ff0c1e98dfdd4d05c6dcaabce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166982 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara --- tools/source/fsys/urlobj.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx index aeb85c1c9f1d..611a14145dde 100644 --- a/tools/source/fsys/urlobj.cxx +++ b/tools/source/fsys/urlobj.cxx @@ -2274,7 +2274,8 @@ INetURLObject::PrefixInfo const * INetURLObject::getPrefix(sal_Unicode const *& sal_Int32 i = 0; for (; pFirst < pLast; ++i) { - if (pFirst->m_pPrefix && pFirst->m_pPrefix[i] == '\0') + assert(pFirst->m_pPrefix && "we start search after the dummy entry"); + if (pFirst->m_pPrefix[i] == '\0') { pMatch = pFirst++; pMatched = p; -- cgit