From 08a9fdddfdb5bed495c7faff2ad5b00f9e5fede0 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 19 Oct 2023 10:21:45 -0700 Subject: [PATCH] QPodArrayOps: don't set the new size in eraseIf() until after copying These are POD types, so there's nothing to be unwound in case of exceptions (and the only one that could happen is the Q_CHECK_PTR). Change-Id: I79e700614d034281bf55fffd178f91fe21685f03 Reviewed-by: Marc Mutz --- src/corelib/tools/qarraydataops.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/tools/qarraydataops.h b/src/corelib/tools/qarraydataops.h index 6ef378a085..78b0107655 100644 --- a/src/corelib/tools/qarraydataops.h +++ b/src/corelib/tools/qarraydataops.h @@ -236,7 +236,7 @@ public: if (it == end) return result; - QPodArrayOps other(this->size, this->size); + QPodArrayOps other(this->size); Q_CHECK_PTR(other.data()); auto dest = other.begin(); // std::uninitialized_copy will fallback to ::memcpy/memmove()