diff --git a/autobuild.xml b/autobuild.xml
index 263a995c87..b5438424b3 100755
--- a/autobuild.xml
+++ b/autobuild.xml
@@ -1814,7 +1814,7 @@
hash
2fbd3c2523c45923245b55551fae5e53
url
- http://viewer.catznip.com/downloads/openjpeg-1.4-windows-20110622.tar.bz2
+ http://downloads.phoenixviewer.com/openjpeg-1.4-windows-20110622.tar.bz2
name
windows
diff --git a/indra/llcommon/llmetricperformancetester.cpp b/indra/llcommon/llmetricperformancetester.cpp
index 41d3eb0bf3..731e58bd20 100644
--- a/indra/llcommon/llmetricperformancetester.cpp
+++ b/indra/llcommon/llmetricperformancetester.cpp
@@ -100,7 +100,7 @@ LLSD LLMetricPerformanceTesterBasic::analyzeMetricPerformanceLog(std::istream& i
LLSD ret;
LLSD cur;
- while (!is.eof() && LLSDSerialize::fromXML(cur, is))
+ while (!is.eof() && LLSDParser::PARSE_FAILURE != LLSDSerialize::fromXML(cur, is))
{
for (LLSD::map_iterator iter = cur.beginMap(); iter != cur.endMap(); ++iter)
{
diff --git a/indra/llcommon/llsdserialize.h b/indra/llcommon/llsdserialize.h
index 86e3fc864c..e7a5507385 100644
--- a/indra/llcommon/llsdserialize.h
+++ b/indra/llcommon/llsdserialize.h
@@ -300,7 +300,7 @@ public:
/**
* @brief Constructor
*/
- LLSDXMLParser();
+ LLSDXMLParser(bool emit_errors=true);
protected:
/**
@@ -747,25 +747,25 @@ public:
return f->format(sd, str, LLSDFormatter::OPTIONS_PRETTY);
}
- static S32 fromXMLEmbedded(LLSD& sd, std::istream& str)
+ static S32 fromXMLEmbedded(LLSD& sd, std::istream& str, bool emit_errors=true)
{
// no need for max_bytes since xml formatting is not
// subvertable by bad sizes.
- LLPointer p = new LLSDXMLParser;
+ LLPointer p = new LLSDXMLParser(emit_errors);
return p->parse(str, sd, LLSDSerialize::SIZE_UNLIMITED);
}
// Line oriented parser, 30% faster than fromXML(), but can
// only be used when you know you have the complete XML
// document available in the stream.
- static S32 fromXMLDocument(LLSD& sd, std::istream& str)
+ static S32 fromXMLDocument(LLSD& sd, std::istream& str, bool emit_errors=true)
{
- LLPointer p = new LLSDXMLParser();
+ LLPointer p = new LLSDXMLParser(emit_errors);
return p->parseLines(str, sd);
}
- static S32 fromXML(LLSD& sd, std::istream& str)
+ static S32 fromXML(LLSD& sd, std::istream& str, bool emit_errors=true)
{
- return fromXMLEmbedded(sd, str);
-// return fromXMLDocument(sd, str);
+ return fromXMLEmbedded(sd, str, emit_errors);
+// return fromXMLDocument(sd, str, emit_errors);
}
/*
diff --git a/indra/llcommon/llsdserialize_xml.cpp b/indra/llcommon/llsdserialize_xml.cpp
index 9ca56ba96a..1b233e8ebd 100644
--- a/indra/llcommon/llsdserialize_xml.cpp
+++ b/indra/llcommon/llsdserialize_xml.cpp
@@ -251,7 +251,7 @@ std::string LLSDXMLFormatter::escapeString(const std::string& in)
class LLSDXMLParser::Impl
{
public:
- Impl();
+ Impl(bool emit_errors);
~Impl();
S32 parse(std::istream& input, LLSD& data);
@@ -295,6 +295,7 @@ private:
static const XML_Char* findAttribute(const XML_Char* name, const XML_Char** pairs);
+ bool mEmitErrors;
XML_Parser mParser;
@@ -317,7 +318,8 @@ private:
};
-LLSDXMLParser::Impl::Impl()
+LLSDXMLParser::Impl::Impl(bool emit_errors)
+ : mEmitErrors(emit_errors)
{
mParser = XML_ParserCreate(NULL);
reset();
@@ -404,7 +406,10 @@ S32 LLSDXMLParser::Impl::parse(std::istream& input, LLSD& data)
{
((char*) buffer)[count ? count - 1 : 0] = '\0';
}
- llinfos << "LLSDXMLParser::Impl::parse: XML_STATUS_ERROR parsing:" << (char*) buffer << llendl;
+ if (mEmitErrors)
+ {
+ llinfos << "LLSDXMLParser::Impl::parse: XML_STATUS_ERROR parsing:" << (char*) buffer << llendl;
+ }
data = LLSD();
return LLSDParser::PARSE_FAILURE;
}
@@ -482,7 +487,10 @@ S32 LLSDXMLParser::Impl::parseLines(std::istream& input, LLSD& data)
if (status == XML_STATUS_ERROR
&& !mGracefullStop)
{
- llinfos << "LLSDXMLParser::Impl::parseLines: XML_STATUS_ERROR" << llendl;
+ if (mEmitErrors)
+ {
+ llinfos << "LLSDXMLParser::Impl::parseLines: XML_STATUS_ERROR" << llendl;
+ }
return LLSDParser::PARSE_FAILURE;
}
@@ -923,7 +931,7 @@ LLSDXMLParser::Impl::Element LLSDXMLParser::Impl::readElement(const XML_Char* na
/**
* LLSDXMLParser
*/
-LLSDXMLParser::LLSDXMLParser() : impl(* new Impl)
+LLSDXMLParser::LLSDXMLParser(bool emit_errors /* = true */) : impl(* new Impl(emit_errors))
{
}
diff --git a/indra/llcrashlogger/llcrashlogger.cpp b/indra/llcrashlogger/llcrashlogger.cpp
index 28e0c35bee..ddde34e628 100644
--- a/indra/llcrashlogger/llcrashlogger.cpp
+++ b/indra/llcrashlogger/llcrashlogger.cpp
@@ -163,7 +163,7 @@ void LLCrashLogger::gatherFiles()
// Look for it in the debug_info.log file
if (debug_log_file.is_open())
- {
+ {
LLSDSerialize::fromXML(mDebugLog, debug_log_file);
mCrashInPreviousExec = mDebugLog["CrashNotHandled"].asBoolean();
diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp
index a10f7132af..65cba3ef17 100644
--- a/indra/llmessage/llavatarnamecache.cpp
+++ b/indra/llmessage/llavatarnamecache.cpp
@@ -460,8 +460,10 @@ void LLAvatarNameCache::cleanupClass()
void LLAvatarNameCache::importFile(std::istream& istr)
{
LLSD data;
- S32 parse_count = LLSDSerialize::fromXMLDocument(data, istr);
- if (parse_count < 1) return;
+ if (LLSDParser::PARSE_FAILURE == LLSDSerialize::fromXMLDocument(data, istr))
+ {
+ return;
+ }
// by convention LLSD storage is a map
// we only store one entry in the map
diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp
index 3a40911015..4ac7f5d783 100644
--- a/indra/llmessage/llcachename.cpp
+++ b/indra/llmessage/llcachename.cpp
@@ -312,8 +312,10 @@ boost::signals2::connection LLCacheName::addObserver(const LLCacheNameCallback&
bool LLCacheName::importFile(std::istream& istr)
{
LLSD data;
- if(LLSDSerialize::fromXMLDocument(data, istr) < 1)
+ if(LLSDParser::PARSE_FAILURE == LLSDSerialize::fromXMLDocument(data, istr))
+ {
return false;
+ }
// We'll expire entries more than a week old
U32 now = (U32)time(NULL);
diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp
index 13ef48da36..3054bb5a7c 100644
--- a/indra/llmessage/llcurl.cpp
+++ b/indra/llmessage/llcurl.cpp
@@ -175,9 +175,11 @@ void LLCurl::Responder::completedRaw(
{
LLSD content;
LLBufferStream istr(channels, buffer.get());
- if (!LLSDSerialize::fromXML(content, istr))
+ const bool emit_errors = false;
+ if (LLSDParser::PARSE_FAILURE == LLSDSerialize::fromXML(content, istr, emit_errors))
{
llinfos << "Failed to deserialize LLSD. " << mURL << " [" << status << "]: " << reason << llendl;
+ content["reason"] = reason;
}
completed(status, reason, content);
diff --git a/indra/llplugin/llpluginprocessparent.cpp b/indra/llplugin/llpluginprocessparent.cpp
index 5deeaa1324..3377c5eeb0 100644
--- a/indra/llplugin/llpluginprocessparent.cpp
+++ b/indra/llplugin/llpluginprocessparent.cpp
@@ -31,6 +31,7 @@
#include "llpluginprocessparent.h"
#include "llpluginmessagepipe.h"
#include "llpluginmessageclasses.h"
+#include "llsdserialize.h"
#include "stringize.h"
#include "llapr.h"
@@ -855,7 +856,7 @@ void LLPluginProcessParent::receiveMessageRaw(const std::string &message)
LL_DEBUGS("Plugin") << "Received: " << message << LL_ENDL;
LLPluginMessage parsed;
- if(parsed.parse(message) != -1)
+ if(LLSDParser::PARSE_FAILURE != parsed.parse(message))
{
if(parsed.hasValue("blocking_request"))
{
diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp
index 62cfecab52..7f7391fc21 100644
--- a/indra/llprimitive/llmodel.cpp
+++ b/indra/llprimitive/llmodel.cpp
@@ -191,6 +191,13 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector& fa
LLVolumeFace::VertexData cv;
if (pos_source)
{
+ // FIRE-9394; Guard against all kind of out of bounds access
+ if( i+pos_offset >= idx.getCount() )
+ return LLModel::BAD_ELEMENT;
+ if( (idx[i+pos_offset]*3+2) >= v.getCount() )
+ return LLModel::BAD_ELEMENT;
+ //
+
cv.setPosition(LLVector4a(v[idx[i+pos_offset]*3+0],
v[idx[i+pos_offset]*3+1],
v[idx[i+pos_offset]*3+2]));
@@ -198,12 +205,26 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector& fa
if (tc_source)
{
+ // FIRE-9394; Guard against all kind of out of bounds access
+ if( i+tc_offset >= idx.getCount() )
+ return LLModel::BAD_ELEMENT;
+ if( (idx[i+tc_offset]*2+1) >= tc.getCount() )
+ return LLModel::BAD_ELEMENT;
+ //
+
cv.mTexCoord.setVec(tc[idx[i+tc_offset]*2+0],
tc[idx[i+tc_offset]*2+1]);
}
if (norm_source)
{
+ // FIRE-9394; Guard against all kind of out of bounds access
+ if( i+norm_offset >= idx.getCount() )
+ return LLModel::BAD_ELEMENT;
+ if( (idx[i+norm_offset]*3+2) >= n.getCount() )
+ return LLModel::BAD_ELEMENT;
+ //
+
cv.setNormal(LLVector4a(n[idx[i+norm_offset]*3+0],
n[idx[i+norm_offset]*3+1],
n[idx[i+norm_offset]*3+2]));
@@ -394,6 +415,13 @@ LLModel::EModelStatus load_face_from_dom_polylist(std::vector& fac
}
//
+ // FIRE-9394; Guard against all kind of out of bounds access
+ if( cur_idx+pos_offset >= idx.getCount() )
+ return LLModel::BAD_ELEMENT;
+ if( (idx[cur_idx+pos_offset]*3+2) >= v.getCount() )
+ return LLModel::BAD_ELEMENT;
+ //
+
cv.getPosition().set(v[idx[cur_idx+pos_offset]*3+0],
v[idx[cur_idx+pos_offset]*3+1],
v[idx[cur_idx+pos_offset]*3+2]);
@@ -401,12 +429,26 @@ LLModel::EModelStatus load_face_from_dom_polylist(std::vector& fac
if (tc_source)
{
+ // FIRE-9394; Guard against all kind of out of bounds access
+ if( cur_idx+tc_offset >= idx.getCount() )
+ return LLModel::BAD_ELEMENT;
+ if( (idx[cur_idx+tc_offset]*2+1) >= tc.getCount() )
+ return LLModel::BAD_ELEMENT;
+ //
+
cv.mTexCoord.setVec(tc[idx[cur_idx+tc_offset]*2+0],
tc[idx[cur_idx+tc_offset]*2+1]);
}
if (norm_source)
{
+ // FIRE-9394; Guard against all kind of out of bounds access
+ if( cur_idx+norm_offset >= idx.getCount() )
+ return LLModel::BAD_ELEMENT;
+ if( (idx[cur_idx+norm_offset]*3+2) >= n.getCount() )
+ return LLModel::BAD_ELEMENT;
+ //
+
cv.getNormal().set(n[idx[cur_idx+norm_offset]*3+0],
n[idx[cur_idx+norm_offset]*3+1],
n[idx[cur_idx+norm_offset]*3+2]);
diff --git a/indra/llui/llspellcheck.cpp b/indra/llui/llspellcheck.cpp
index a49560f173..95af4d64d2 100644
--- a/indra/llui/llspellcheck.cpp
+++ b/indra/llui/llspellcheck.cpp
@@ -145,10 +145,14 @@ void LLSpellChecker::refreshDictionaryMap()
// Load dictionary information (file name, friendly name, ...)
llifstream user_file(user_path + DICT_FILE_MAIN, std::ios::binary);
- if ( (!user_file.is_open()) || (0 == LLSDSerialize::fromXMLDocument(sDictMap, user_file)) || (0 == sDictMap.size()) )
+ if ( (!user_file.is_open())
+ || (LLSDParser::PARSE_FAILURE == LLSDSerialize::fromXMLDocument(sDictMap, user_file))
+ || (0 == sDictMap.size()) )
{
llifstream app_file(app_path + DICT_FILE_MAIN, std::ios::binary);
- if ( (!app_file.is_open()) || (0 == LLSDSerialize::fromXMLDocument(sDictMap, app_file)) || (0 == sDictMap.size()) )
+ if ( (!app_file.is_open())
+ || (LLSDParser::PARSE_FAILURE == LLSDSerialize::fromXMLDocument(sDictMap, app_file))
+ || (0 == sDictMap.size()) )
{
return;
}
diff --git a/indra/llxml/llcontrol.cpp b/indra/llxml/llcontrol.cpp
index 1dcd909a4d..53fbcbda64 100644
--- a/indra/llxml/llcontrol.cpp
+++ b/indra/llxml/llcontrol.cpp
@@ -940,12 +940,10 @@ U32 LLControlGroup::loadFromFile(const std::string& filename, bool set_default_v
return 0;
}
- S32 ret = LLSDSerialize::fromXML(settings, infile);
-
- if (ret <= 0)
+ if (LLSDParser::PARSE_FAILURE == LLSDSerialize::fromXML(settings, infile))
{
infile.close();
- llwarns << "Unable to open LLSD control file " << filename << ". Trying Legacy Method." << llendl;
+ llwarns << "Unable to parse LLSD control file " << filename << ". Trying Legacy Method." << llendl;
return loadFromFileLegacy(filename, TRUE, TYPE_STRING);
}
diff --git a/indra/newview/aoengine.cpp b/indra/newview/aoengine.cpp
index db5007dcbb..441a3476e3 100644
--- a/indra/newview/aoengine.cpp
+++ b/indra/newview/aoengine.cpp
@@ -19,6 +19,7 @@
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * $/LicenseInfo$
*/
#include "llviewerprecompiledheaders.h"
diff --git a/indra/newview/aoengine.h b/indra/newview/aoengine.h
index dd17d435b4..ee4ebbf407 100644
--- a/indra/newview/aoengine.h
+++ b/indra/newview/aoengine.h
@@ -19,6 +19,7 @@
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * $/LicenseInfo$
*/
#ifndef AOENGINE_H
diff --git a/indra/newview/aoset.cpp b/indra/newview/aoset.cpp
index 068cc55135..76807926f7 100644
--- a/indra/newview/aoset.cpp
+++ b/indra/newview/aoset.cpp
@@ -19,6 +19,7 @@
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * $/LicenseInfo$
*/
#include "llviewerprecompiledheaders.h"
diff --git a/indra/newview/aoset.h b/indra/newview/aoset.h
index 555b57f70b..3293975b3d 100644
--- a/indra/newview/aoset.h
+++ b/indra/newview/aoset.h
@@ -19,6 +19,7 @@
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * $/LicenseInfo$
*/
#ifndef AOSET_H
diff --git a/indra/newview/app_settings/grids.fallback.xml b/indra/newview/app_settings/grids.fallback.xml
index 212506aa0e..49dcc04f26 100644
--- a/indra/newview/app_settings/grids.fallback.xml
+++ b/indra/newview/app_settings/grids.fallback.xml
@@ -178,39 +178,10 @@
login.aurorascape.com:8002
login.avination.com/