From 5e1a5a78d912896b7e03ac01f336ed1b109a2b22 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 11 Jan 2016 16:23:18 -0800 Subject: QVariant: make sure to default-initialize in v_construct MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise it's possible to get garbage for primitive types (trivially constructible) under some conditions. Change-Id: I408dcb81ba654c929f25ffff142885fc62395948 Reviewed-by: Marc Mutz Reviewed-by: Jędrzej Nowacki Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/corelib/kernel/qvariant_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/kernel/qvariant_p.h b/src/corelib/kernel/qvariant_p.h index d84d702982..4a090b5f12 100644 --- a/src/corelib/kernel/qvariant_p.h +++ b/src/corelib/kernel/qvariant_p.h @@ -121,7 +121,7 @@ inline void v_construct(QVariant::Private *x, const void *copy, T * = 0) if (copy) new (&x->data.ptr) T(*static_cast(copy)); else - new (&x->data.ptr) T; + new (&x->data.ptr) T(); } } -- cgit v1.2.3