summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2010-04-05 16:54:10 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2010-04-05 18:39:52 -0300
commit72af00dc0491b5c2f14bf0fd3c4d2c5e3fdf4c71 (patch)
tree4101f638d4d04b29eab75b2b242a071500ed55a6
parent8752f1655bbd65cd5588fa6246c1fe274e2a0f5e (diff)
downloadshiboken-72af00dc0491b5c2f14bf0fd3c4d2c5e3fdf4c71.tar.gz
shiboken-72af00dc0491b5c2f14bf0fd3c4d2c5e3fdf4c71.tar.xz
shiboken-72af00dc0491b5c2f14bf0fd3c4d2c5e3fdf4c71.zip
Do not segfault when a null pointer is passed to Str constructor.
-rw-r--r--tests/libsample/str.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/libsample/str.cpp b/tests/libsample/str.cpp
index cbd45639..476bfa40 100644
--- a/tests/libsample/str.cpp
+++ b/tests/libsample/str.cpp
@@ -59,7 +59,8 @@ Str::Str(const char* cstr)
void
Str::init(const char* cstr)
{
- m_str = cstr;
+ if (cstr)
+ m_str = cstr;
}
Str::~Str()