diff options
author | Aaron Brashears <aaronb@lindenlab.com> | 2009-03-05 19:22:07 +0000 |
---|---|---|
committer | Aaron Brashears <aaronb@lindenlab.com> | 2009-03-05 19:22:07 +0000 |
commit | 30d5d834379c421a4146cb23d640b770e79892d6 (patch) | |
tree | 9b81e345afe0158d3865327797870098136db691 /indra | |
parent | cdbd97c41fb43ced0fa55e77eac65057ac2b71ad (diff) |
bail if data_size is zero. crashes windows application since it throws an exception. undefined behavior is undefined. DEV-28045
Diffstat (limited to 'indra')
-rwxr-xr-x | indra/llmessage/llsdmessagereader.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/indra/llmessage/llsdmessagereader.cpp b/indra/llmessage/llsdmessagereader.cpp index c47d4b78bc..e699ec9e28 100755 --- a/indra/llmessage/llsdmessagereader.cpp +++ b/indra/llmessage/llsdmessagereader.cpp @@ -108,6 +108,12 @@ void LLSDMessageReader::getBinaryData(const char *block, const char *var, data_size = max_size; } + // Calls to memcpy will fail if data_size is not positive. + // Phoenix 2009-02-27 + if(data_size <= 0) + { + return; + } memcpy(datap, &(data[0]), data_size); } |