vcl/source/gdi/impglyphitem.cxx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
New commits: commit f89c72437b9db889148258f489669587372a2bd1 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Sun Nov 4 16:07:36 2018 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Sun Nov 4 18:09:26 2018 +0100 coverity#1440844 Uninitialized pointer read Change-Id: I5ae1c023bfff4f5d45f8ea8104a58dbd89a5d983 Reviewed-on: https://gerrit.libreoffice.org/62852 Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/vcl/source/gdi/impglyphitem.cxx b/vcl/source/gdi/impglyphitem.cxx index 55b1fbd5136e..809b70bc91bc 100644 --- a/vcl/source/gdi/impglyphitem.cxx +++ b/vcl/source/gdi/impglyphitem.cxx @@ -30,12 +30,18 @@ SalLayoutGlyphs::SalLayoutGlyphs() SalLayoutGlyphs::~SalLayoutGlyphs() { delete m_pImpl; } -SalLayoutGlyphs::SalLayoutGlyphs(const SalLayoutGlyphs& rOther) { operator=(rOther); } +SalLayoutGlyphs::SalLayoutGlyphs(const SalLayoutGlyphs& rOther) +{ + m_pImpl = rOther.m_pImpl ? rOther.m_pImpl->clone(*this) : nullptr; +} SalLayoutGlyphs& SalLayoutGlyphs::operator=(const SalLayoutGlyphs& rOther) { - delete m_pImpl; - m_pImpl = rOther.m_pImpl ? rOther.m_pImpl->clone(*this) : nullptr; + if (this != &rOther) + { + delete m_pImpl; + m_pImpl = rOther.m_pImpl ? rOther.m_pImpl->clone(*this) : nullptr; + } return *this; } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits