summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorNicky <none@none>2012-07-12 18:04:53 +0200
committerNicky <none@none>2012-07-12 18:04:53 +0200
commit2005b4fed4dcfc17ec46d21ce093dbc6a368083b (patch)
treebb2f25e014bae01861338f73af2278ccf1af3eba /indra
parent60393abdad98c61d9cb01d004e3d69bd8d34bfda (diff)
Crashfix: in ll_safe_string not only guard against 0 pointer, but against illegal length of buffer too.
Diffstat (limited to 'indra')
-rw-r--r--indra/llcommon/llstring.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp
index fa0eb9f72c..0c32679744 100644
--- a/indra/llcommon/llstring.cpp
+++ b/indra/llcommon/llstring.cpp
@@ -47,7 +47,8 @@ std::string ll_safe_string(const char* in)
std::string ll_safe_string(const char* in, S32 maxlen)
{
- if(in) return std::string(in, maxlen);
+ if(in && maxlen > 0 ) return std::string(in, maxlen);
+
return std::string();
}