aboutsummaryrefslogtreecommitdiffstats
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)
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 cbd45639d..476bfa409 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()