Skip to content

Commit 9a9ece6

Browse files
pleathakroshg
authored andcommitted
CVE-2019-0860 [ChakraCore] - possible Security Issue - Individual
1 parent 4cb3bbd commit 9a9ece6

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

lib/Backend/GlobOpt.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3258,10 +3258,14 @@ GlobOpt::OptSrc(IR::Opnd *opnd, IR::Instr * *pInstr, Value **indirIndexValRef, I
32583258
}
32593259
originalPropertySym = sym->AsPropertySym();
32603260

3261-
// Dont give a vale to 'arguments' property sym to prevent field copy prop of 'arguments'
3261+
// Don't give a value to 'arguments' property sym to prevent field copy prop of 'arguments'
32623262
if (originalPropertySym->AsPropertySym()->m_propertyId == Js::PropertyIds::arguments &&
32633263
originalPropertySym->AsPropertySym()->m_fieldKind == PropertyKindData)
32643264
{
3265+
if (opnd->AsSymOpnd()->IsPropertySymOpnd())
3266+
{
3267+
this->FinishOptPropOp(instr, opnd->AsPropertySymOpnd());
3268+
}
32653269
return nullptr;
32663270
}
32673271

lib/Backend/Lower.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6223,7 +6223,7 @@ Lowerer::GenerateLdFldWithCachedType(IR::Instr * instrLdFld, bool* continueAsHel
62236223

62246224
// Load the value from the slot, getting the slot ID from the cache.
62256225
uint16 index = propertySymOpnd->GetSlotIndex();
6226-
Assert(index != -1);
6226+
AssertOrFailFast(index != (uint16)-1);
62276227

62286228
if (opndSlotArray->IsRegOpnd())
62296229
{
@@ -7204,7 +7204,7 @@ Lowerer::GenerateDirectFieldStore(IR::Instr* instrStFld, IR::PropertySymOpnd* pr
72047204

72057205
// Store the value to the slot, getting the slot index from the cache.
72067206
uint16 index = propertySymOpnd->GetSlotIndex();
7207-
Assert(index != -1);
7207+
AssertOrFailFast(index != (uint16)-1);
72087208

72097209
#if defined(RECYCLER_WRITE_BARRIER_JIT) && (defined(_M_IX86) || defined(_M_AMD64))
72107210
if (opndSlotArray->IsRegOpnd())

0 commit comments

Comments
 (0)