summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qbytearray.h
diff options
context:
space:
mode:
authorRobert Griebl <rgriebl@trolltech.com>2009-09-10 14:14:59 (GMT)
committerRobert Griebl <rgriebl@trolltech.com>2009-09-11 11:18:52 (GMT)
commite2411ebd04bf9a55e6e3b24cc7886e597521d473 (patch)
tree76344082302b32f21977bd0b57e2546c8abed2a8 /src/corelib/tools/qbytearray.h
parenta5a27973b1e4df62217ed510229b0d8dfa70e354 (diff)
downloadQt-e2411ebd04bf9a55e6e3b24cc7886e597521d473.zip
Qt-e2411ebd04bf9a55e6e3b24cc7886e597521d473.tar.gz
Qt-e2411ebd04bf9a55e6e3b24cc7886e597521d473.tar.bz2
Out of memory fix for qUncompress
qUncompress shouldn't crash when running out of memory, since it might deal with buffers which are not under user control (same behavior as Qt 4.5). It will however throw a std::bad_alloc exception if Qt is compiled with exception handling. Reviewed-by: Harald Fernengel Reviewed-by: Ralf Engels Reviewed-by: Lars Knoll
Diffstat (limited to 'src/corelib/tools/qbytearray.h')
-rw-r--r--src/corelib/tools/qbytearray.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/corelib/tools/qbytearray.h b/src/corelib/tools/qbytearray.h
index 191f6a2..9621dbf 100644
--- a/src/corelib/tools/qbytearray.h
+++ b/src/corelib/tools/qbytearray.h
@@ -372,6 +372,7 @@ private:
friend class QByteRef;
friend class QString;
+ friend QByteArray qUncompress(const uchar *data, int nbytes);
public:
typedef Data * DataPtr;
inline DataPtr &data_ptr() { return d; }