Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions lib/Runtime/Base/WindowsGlobalizationAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,12 +349,15 @@ namespace Js
{
boolean retVal;
HRESULT hr;
HSTRING hString;
HSTRING hString = nullptr;
HSTRING_HEADER hStringHdr;
// OK for languageTag to get truncated as it would pass incomplete languageTag below which
// will be rejected by globalization dll
IfFailThrowHr(GetWindowsGlobalizationLibrary(scriptContext)->WindowsCreateStringReference(languageTag, static_cast<UINT32>(wcslen(languageTag)), &hStringHdr, &hString));
AnalysisAssert(hString);
if (hString == nullptr)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this because Prefast wouldn't let it pass.
For some reason the function IsWellFormed doesn't allow null in the signature, but supports it.

{
return 0;
}
IfFailThrowHr(this->languageStatics->IsWellFormed(hString, &retVal));
return retVal;
}
Expand Down