From 94b10b9b2946ddd222ccf5f08f873a0361eca976 Mon Sep 17 00:00:00 2001 From: Jehan Date: Sun, 14 May 2017 19:49:01 +0200 Subject: [PATCH] Bug 101030 - Buffer overflow related to ISO2022JP detection in... ... en:ascii and ja:iso-2022-jp tests. I don't know much about this part of the code at this point. Yet I can clearly deduct that the length of the charLenTable is supposed to be the classFactor of the SMModel. Therefore 2 classes were missing in ISO2022JPCharLenTable, hence a buffer overflow happens when trying to reach these. I am not sure of the values I should add there. For now, let's set 0 to both, but adding also a comment so that I can review this code later on, when I will get to read and understand this piece of code in more depth. --- src/nsEscSM.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/nsEscSM.cpp b/src/nsEscSM.cpp index eed1b7c..dcc252c 100644 --- a/src/nsEscSM.cpp +++ b/src/nsEscSM.cpp @@ -197,7 +197,11 @@ PCK4BITS(eError,eError,eError,eItsMe,eError,eError,eError,eError),//38-3f PCK4BITS(eError,eError,eError,eError,eItsMe,eError,eStart,eStart) //40-47 }; -static const PRUint32 ISO2022JPCharLenTable[] = {0, 0, 0, 0, 0, 0, 0, 0}; +/* XXX: I needed to complete the 2 last classes for this CharLenTable + * but I did it a bit randomly. Cf. bug 101030. + * Let's check this piece of code again later when I understand it + * better. */ +static const PRUint32 ISO2022JPCharLenTable[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; const SMModel ISO2022JPSMModel = { {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, ISO2022JP_cls },