summaryrefslogtreecommitdiff
path: root/indra/newview/llmachineid.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llmachineid.cpp')
-rw-r--r--indra/newview/llmachineid.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/indra/newview/llmachineid.cpp b/indra/newview/llmachineid.cpp
index 2001359e50..51127928d1 100644
--- a/indra/newview/llmachineid.cpp
+++ b/indra/newview/llmachineid.cpp
@@ -217,6 +217,13 @@ S32 LLMachineID::init()
// Get the value of the Name property
hr = pclsObj->Get(L"SerialNumber", 0, &vtProp, 0, 0);
+ if (FAILED(hr))
+ {
+ LL_WARNS() << "Failed to get SerialNumber. Error code = 0x" << hex << hres << LL_ENDL;
+ pclsObj->Release();
+ pclsObj = NULL;
+ continue;
+ }
LL_INFOS("AppInit") << " Serial Number : " << vtProp.bstrVal << LL_ENDL;
// use characters in the returned Serial Number to create a byte array of size len
@@ -224,11 +231,11 @@ S32 LLMachineID::init()
unsigned int serial_size = SysStringLen(serialNumber);
unsigned int j = 0;
- while (j < serial_size)
+ while (j < serial_size && vtProp.bstrVal[j] != 0)
{
for (unsigned int i = 0; i < len; i++)
{
- if (j >= serial_size)
+ if (j >= serial_size || vtProp.bstrVal[j] == 0)
break;
static_unique_id[i] = (unsigned int)(static_unique_id[i] + serialNumber[j]);