sc/source/filter/xml/xmlcelli.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
New commits: commit b2e60fb56e8f8f0b99fdaf3162034db19a80fd7b Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Thu Nov 21 14:49:59 2024 +0000 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Thu Nov 21 22:03:39 2024 +0100 ofz#380107559 fods2xlsfuzzer Null-dereference READ in SvXMLStylesContext::FindStyleChildContext Change-Id: I384e8e36bc23b7d84b7ccda34e1ee29109e5f708 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176942 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx index 1b9671fabd2f..17b2a1a6b3c6 100644 --- a/sc/source/filter/xml/xmlcelli.cxx +++ b/sc/source/filter/xml/xmlcelli.cxx @@ -843,10 +843,11 @@ void ScXMLTableRowCellContext::SetAnnotation(const ScAddress& rPos) /* Don't attempt to get the style from the SdrObject, as it might be a default assigned one. */ - auto pStyle = rXMLImport.GetShapeImport()->GetAutoStylesContext()->FindStyleChildContext( - XmlStyleFamily::SD_GRAPHICS_ID, mxAnnotationData->maStyleName); + const SvXMLStylesContext* pStylesCtxt = rXMLImport.GetShapeImport()->GetAutoStylesContext(); + const SvXMLStyleContext* pStyle = pStylesCtxt ? pStylesCtxt->FindStyleChildContext( + XmlStyleFamily::SD_GRAPHICS_ID, mxAnnotationData->maStyleName) : nullptr; OUString aStyleName = pStyle ? pStyle->GetParentName() : mxAnnotationData->maStyleName; - assert(!rXMLImport.GetShapeImport()->GetAutoStylesContext()->FindStyleChildContext( + assert(!pStylesCtxt || !pStylesCtxt->FindStyleChildContext( XmlStyleFamily::SD_GRAPHICS_ID, aStyleName)); aStyleName = rXMLImport.GetStyleDisplayName(XmlStyleFamily::SD_GRAPHICS_ID, aStyleName);