From b549c9f26b31a968438da5ffb13bd578e4483146 Mon Sep 17 00:00:00 2001
From: Toby Murray <toby.murray@unimelb.edu.au>
Date: Tue, 10 Sep 2019 14:33:32 +1000
Subject: [PATCH] reduce maximum number of instructions to ensure quick running
time when we are given pathaological input that produces unbalanced binary
tree
---
src/passbook-vuln-1.c | 2 +-
src/passbook-vuln-2.c | 2 +-
src/passbook-vuln-3.c | 2 +-
src/passbook-vuln-4.c | 2 +-
src/passbook-vuln-5.c | 2 +-
src/passbook.c | 2 +-
6 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/passbook-vuln-1.c b/src/passbook-vuln-1.c
index cfbd180..9a6227d 100644
--- a/src/passbook-vuln-1.c
+++ b/src/passbook-vuln-1.c
@@ -215,7 +215,7 @@ unsigned int tokenise(char *str, char * toks[], unsigned int toksLen){
}
#define MAX_LINE_LENGTH 1022
-#define MAX_INSTRUCTIONS 65536
+#define MAX_INSTRUCTIONS 1024
/* two extra chars in each line: the newline '\n' and NUL '\0' */
#define INSTRUCTION_LENGTH (MAX_LINE_LENGTH+2)
diff --git a/src/passbook-vuln-2.c b/src/passbook-vuln-2.c
index cfbd180..9a6227d 100644
--- a/src/passbook-vuln-2.c
+++ b/src/passbook-vuln-2.c
@@ -215,7 +215,7 @@ unsigned int tokenise(char *str, char * toks[], unsigned int toksLen){
}
#define MAX_LINE_LENGTH 1022
-#define MAX_INSTRUCTIONS 65536
+#define MAX_INSTRUCTIONS 1024
/* two extra chars in each line: the newline '\n' and NUL '\0' */
#define INSTRUCTION_LENGTH (MAX_LINE_LENGTH+2)
diff --git a/src/passbook-vuln-3.c b/src/passbook-vuln-3.c
index cfbd180..9a6227d 100644
--- a/src/passbook-vuln-3.c
+++ b/src/passbook-vuln-3.c
@@ -215,7 +215,7 @@ unsigned int tokenise(char *str, char * toks[], unsigned int toksLen){
}
#define MAX_LINE_LENGTH 1022
-#define MAX_INSTRUCTIONS 65536
+#define MAX_INSTRUCTIONS 1024
/* two extra chars in each line: the newline '\n' and NUL '\0' */
#define INSTRUCTION_LENGTH (MAX_LINE_LENGTH+2)
diff --git a/src/passbook-vuln-4.c b/src/passbook-vuln-4.c
index cfbd180..9a6227d 100644
--- a/src/passbook-vuln-4.c
+++ b/src/passbook-vuln-4.c
@@ -215,7 +215,7 @@ unsigned int tokenise(char *str, char * toks[], unsigned int toksLen){
}
#define MAX_LINE_LENGTH 1022
-#define MAX_INSTRUCTIONS 65536
+#define MAX_INSTRUCTIONS 1024
/* two extra chars in each line: the newline '\n' and NUL '\0' */
#define INSTRUCTION_LENGTH (MAX_LINE_LENGTH+2)
diff --git a/src/passbook-vuln-5.c b/src/passbook-vuln-5.c
index cfbd180..9a6227d 100644
--- a/src/passbook-vuln-5.c
+++ b/src/passbook-vuln-5.c
@@ -215,7 +215,7 @@ unsigned int tokenise(char *str, char * toks[], unsigned int toksLen){
}
#define MAX_LINE_LENGTH 1022
-#define MAX_INSTRUCTIONS 65536
+#define MAX_INSTRUCTIONS 1024
/* two extra chars in each line: the newline '\n' and NUL '\0' */
#define INSTRUCTION_LENGTH (MAX_LINE_LENGTH+2)
diff --git a/src/passbook.c b/src/passbook.c
index cfbd180..9a6227d 100644
--- a/src/passbook.c
+++ b/src/passbook.c
@@ -215,7 +215,7 @@ unsigned int tokenise(char *str, char * toks[], unsigned int toksLen){
}
#define MAX_LINE_LENGTH 1022
-#define MAX_INSTRUCTIONS 65536
+#define MAX_INSTRUCTIONS 1024
/* two extra chars in each line: the newline '\n' and NUL '\0' */
#define INSTRUCTION_LENGTH (MAX_LINE_LENGTH+2)
--
GitLab