summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2011-01-31 22:58:56 -0500
committerNat Goodspeed <nat@lindenlab.com>2011-01-31 22:58:56 -0500
commit1fda4964326f5552b47abfc8e9a01d9cb2fe89e7 (patch)
treea5eaa1818ee9bf1722bc411b9a8b5f7683106378
parentd6e95923294483a5044fb6c66f7530442d55d338 (diff)
Fix crash bug in array-style metadata query for nullary functions.
The shortcut way to construct an LLSD array of size n is to assign LLSD() to array[n-1]. That's fine -- as long as you remember not to do it for n == 0.
-rw-r--r--indra/llcommon/lleventdispatcher.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/indra/llcommon/lleventdispatcher.cpp b/indra/llcommon/lleventdispatcher.cpp
index 2ab006a173..e00cca366f 100644
--- a/indra/llcommon/lleventdispatcher.cpp
+++ b/indra/llcommon/lleventdispatcher.cpp
@@ -443,7 +443,8 @@ struct LLEventDispatcher::ArrayParamsDispatchEntry: public LLEventDispatcher::Pa
{
LLSD array(LLSD::emptyArray());
// Resize to number of arguments required
- array[mArity - 1] = LLSD();
+ if (mArity)
+ array[mArity - 1] = LLSD();
llassert_always(array.size() == mArity);
meta["required"] = array;
return meta;