diff options
| author | Peter Kümmel <syntheticpp@gmx.net> | 2012-10-10 16:17:08 +0200 |
|---|---|---|
| committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-10-11 02:47:40 +0200 |
| commit | a47f21edd61ce033475743a35d6dad35f2e68c48 (patch) | |
| tree | aa96b4aefc2d651e2ea331d29a51d59bb2fa7a7f /src/corelib/tools/qbitarray.cpp | |
| parent | 191c0e300b8d625fa93939ecbff777469b816a44 (diff) | |
Make QVarLengthArray exception safe in case of OOM
After a exception is thrown in resize(), QVarLengthArray has an
invalid state with ptr == 0. On the next resize call when malloc
returns a valid pointer, oldPtr is 0 and it could crash in
memcpy because the pointer to the source is 0.
The patch ensures the valid pointer isn't overwritten with NULL.
When exceptions are disabled the user must ensure that malloc will
not fail.
Change-Id: Id12a5e3e1eacc551e4d1b64cba8e8414cfebd6e1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qbitarray.cpp')
0 files changed, 0 insertions, 0 deletions
