diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-07-13 19:54:29 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2024-07-15 11:56:02 +0200 |
commit | 8ddb1cf50e3e981fd1863dae4c56b97919fae22c (patch) | |
tree | 90d330371a49f125708e8c3663f87695e166e2ec /xmloff | |
parent | ce9810cb2d1e87e78f2aac63134001bb4d5c3d53 (diff) |
cid#1608584 Overflowed constant
Change-Id: Ieefa43899f84938ba12227b30a2c9b273ac2c202
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170437
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit b904816f7375ef63c6c86578bed58f8dc06b6125)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170470
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/draw/shapeexport.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 9463b3e64eb8..65709b7bfba3 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -2416,9 +2416,9 @@ OUString getNameFromStreamURL(std::u16string_view rURL) if (o3tl::starts_with(rURL, sPackageURL)) { std::u16string_view sRequestedName = rURL.substr(sPackageURL.size()); - size_t nLastIndex = sRequestedName.rfind('/') + 1; - if ((nLastIndex > 0) && (nLastIndex < sRequestedName.size())) - sRequestedName = sRequestedName.substr(nLastIndex); + size_t nLastIndex = sRequestedName.rfind('/'); + if (nLastIndex != std::u16string_view::npos && nLastIndex + 1 < sRequestedName.size()) + sRequestedName = sRequestedName.substr(nLastIndex + 1); nLastIndex = sRequestedName.rfind('.'); if (nLastIndex != std::u16string_view::npos) sRequestedName = sRequestedName.substr(0, nLastIndex); |