From 505fb3f952106d6fafd300097cce83c2050fbc60 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 21 Jul 2021 17:16:19 +0200 Subject: [PATCH] -Werror=maybe-uninitialized MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit > registry/source/reflwrit.cxx: In member function ‘sal_uInt32 RegistryTypeWriter::getBlopSize()’: > registry/source/reflwrit.cxx:1332:33: error: ‘size’ may be used uninitialized in this function [-Werror=maybe-uninitialized] > 1332 | return ::getBlopSize(m_hImpl); > | ^ at least with recent GCC 12 trunk and --enable-dbgutil --enable-optimized Change-Id: I17abbb55ba31458147afd486a17e8455ede39b32 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119338 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- registry/source/reflwrit.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/registry/source/reflwrit.cxx b/registry/source/reflwrit.cxx index 04be2db6e702..8f8e83318433 100644 --- a/registry/source/reflwrit.cxx +++ b/registry/source/reflwrit.cxx @@ -1207,6 +1207,7 @@ void const * TYPEREG_CALLTYPE typereg_writer_getBlob(void * handle, sal_uInt32 * try { writer->createBlop(); } catch (std::bad_alloc &) { + *size = 0; return nullptr; } }