summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2016-01-11 16:23:18 -0800
committerThiago Macieira <thiago.macieira@intel.com>2016-01-12 19:25:07 +0000
commit5e1a5a78d912896b7e03ac01f336ed1b109a2b22 (patch)
tree8026ae1a53bcce17f82638fb05cc17a356057d1c
parent650b4d0f49a533858327204f1b6a930a63c7986a (diff)
QVariant: make sure to default-initialize in v_construct
Otherwise it's possible to get garbage for primitive types (trivially constructible) under some conditions. Change-Id: I408dcb81ba654c929f25ffff142885fc62395948 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
-rw-r--r--src/corelib/kernel/qvariant_p.h2
1 files changed, 1 insertions, 1 deletions
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<const T *>(copy));
else
- new (&x->data.ptr) T;
+ new (&x->data.ptr) T();
}
}