From bbb8221301bc47b1c92671489ea870b82d2bddd0 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Tue, 15 Aug 2023 14:58:56 -0700 Subject: [PATCH] Handle self-assignment (#1114) Found with cert-oop54-cpp Signed-off-by: Rosen Penev --- taglib/toolkit/tpropertymap.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/taglib/toolkit/tpropertymap.cpp b/taglib/toolkit/tpropertymap.cpp index 3e1d144d..ac17f31e 100644 --- a/taglib/toolkit/tpropertymap.cpp +++ b/taglib/toolkit/tpropertymap.cpp @@ -183,6 +183,9 @@ StringList &PropertyMap::unsupportedData() PropertyMap &PropertyMap::operator=(const PropertyMap &other) { + if(this == &other) + return *this; + SimplePropertyMap::operator=(other); *d = *other.d; return *this;