From 2420a4b90c964bcc2c928c4593652fdf81e0e20f Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Tue, 10 Nov 2009 12:29:20 -0800 Subject: FIX DEV-41949: LLMediaEntry::setWhitelist() and LLMediaEntry::asLLSD() have a contract conflict Review #32 This code will go into both server 1.32 branch and the viewer branch. As proposed in DEV-41949, I've changed setWhitelist(const LLSD &whitelist) to clear the whitelist if the WHITELIST_KEY is not present in the passed-in 'whitelist'. I've also made sure that asLLSD() ensures that the WHITELIST_KEY is erased in the given LLSD. --- indra/llprimitive/llmediaentry.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'indra/llprimitive/llmediaentry.cpp') diff --git a/indra/llprimitive/llmediaentry.cpp b/indra/llprimitive/llmediaentry.cpp index 701300163a..2fc1e5e60c 100644 --- a/indra/llprimitive/llmediaentry.cpp +++ b/indra/llprimitive/llmediaentry.cpp @@ -389,8 +389,12 @@ U32 LLMediaEntry::setWhiteList( const std::vector &whitelist ) U32 LLMediaEntry::setWhiteList( const LLSD &whitelist ) { - // If whitelist is undef, this is a no-op. - if (whitelist.isUndefined()) return LSL_STATUS_OK; + // If whitelist is undef, the whitelist is cleared + if (whitelist.isUndefined()) + { + mWhiteList.clear(); + return LSL_STATUS_OK; + } // However, if the whitelist is an empty array, erase it. if (whitelist.isArray()) -- cgit v1.2.3