summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJehan <jehan@girinstud.io>2017-05-14 19:49:01 +0200
committerJehan <jehan@girinstud.io>2017-05-14 19:49:01 +0200
commit94b10b9b2946ddd222ccf5f08f873a0361eca976 (patch)
treeb5e721308812d87be2bee0d24dc0184aff2c521f
parent64efb1b24c7c88751b56e94acf8c67daaff2e2ab (diff)
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.
-rw-r--r--src/nsEscSM.cpp6
1 files changed, 5 insertions, 1 deletions
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 },