summaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
authorunknown <msvensson@neptunus.(none)>2005-09-27 16:34:49 +0200
committerunknown <msvensson@neptunus.(none)>2005-09-27 16:34:49 +0200
commit32474e2984a9cfc224bfe0bc57f39fb1b2924774 (patch)
tree4c19263324cba199f0c516cd76887a078d27983d /extra
parentdd37fca2693b2a8230a3aaf8be6be6480c0722ed (diff)
downloadmariadb-git-32474e2984a9cfc224bfe0bc57f39fb1b2924774.tar.gz
Bug #13163 yassl: aix52 crash with ssl turned on
- It seems like malloc(0) returns a null pointer on aix52 extra/yassl/mySTL/vector.hpp: Don't allow malloc(0), if n is 0 use 1
Diffstat (limited to 'extra')
-rw-r--r--extra/yassl/mySTL/vector.hpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/extra/yassl/mySTL/vector.hpp b/extra/yassl/mySTL/vector.hpp
index e7f63c37c7c..9eab91cfda8 100644
--- a/extra/yassl/mySTL/vector.hpp
+++ b/extra/yassl/mySTL/vector.hpp
@@ -45,7 +45,8 @@ struct vector_base {
vector_base() : start_(0), finish_(0), end_of_storage_(0) {}
vector_base(size_t n)
{
- start_ = static_cast<T*>(malloc(n * sizeof(T)));
+ // Don't allow malloc(0), if n is 0 use 1
+ start_ = static_cast<T*>(malloc((n ? n : 1) * sizeof(T)));
if (!start_) abort();
finish_ = start_;
end_of_storage_ = start_ + n;