One could argue that passing a negative index to an LLSD array should do something other than shrug and reference element [0], but as that's legacy behavior, it seems all too likely that the viewer sometimes relies on it. This specific problem arises if the index passed to operator[]() is negative -- either with the previous Integer parameter or with size_t (which of course reinterprets the negative index as hugely positive). The non-const ImplArray::ref() overload checks parameter 'i' and, if it appears negative, sets internal 'index' to 0. But in the next stanza, if (index >= existing size()), it calls resize() to scale the internal array up to one more than the requested index. The trouble is that it passed resize(i + 1), not the adjusted resize(index + 1). With a requested index of exactly -1, that would pass resize(0), which would result in the ensuing array[0] reference being invalid. With a requested index less than -1, that would pass resize(hugely positive) -- since, whether operator[]() accepts signed LLSD::Integer or size_t, resize() accepts std::vector::size_type. Given that the footprint of an LLSD array element is at least a pointer, the number of bytes required for resize(hugely positive) is likely to exceed available heap storage. Passing the adjusted resize(index + 1) should defend against that case. |
||
|---|---|---|
| doc | ||
| etc | ||
| indra | ||
| scripts | ||
| .clang-format | ||
| .gitignore | ||
| .pre-commit-config.yaml | ||
| BuildParams | ||
| README.md | ||
| autobuild.xml | ||
| build.sh | ||
README.md
Second Life is a free 3D virtual world where users can create, connect and chat with others from around the world. This repository contains the source code for the official client.
Open Source
Second Life provides a huge variety of tools for expression, content creation, socialization and play. Its vibrancy is only possible because of input and contributions from its residents. The client codebase has been open source since 2007 and is available under the LGPL license. The Open Source Portal contains additional information about Linden Lab's open source history and projects.
Download
Most people use a pre-built viewer release to access Second Life. Windows and macOS builds are published on the official website. More experimental viewers, such as release candidates and project viewers, are detailed on the Alternate Viewers page.
Third Party Viewers
Third party maintained forks, which include Linux compatible builds, are indexed in the Third Party Viewer Directory.
Build Instructions
Contribute
Help make Second Life better! You can get involved with improvements by filing bugs, suggesting enhancements, submitting pull requests and more. See the open source portal for details.
