summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Src/parse.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index b00dbf65d..5b60332b5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2019-03-14  Peter Stephenson  <p.stephenson@samsung.com>
+
+	* Kamil: 44122: Src/parse.c: turn an int into a long to avoid
+	overflow.
+
 2019-03-12  dana  <dana@dana.is>
 
 	* 44100: Completion/Zsh/Command/_zparseopts, Doc/Zsh/mod_zutil.yo,
diff --git a/Src/parse.c b/Src/parse.c
index 83383f10c..22e553a16 100644
--- a/Src/parse.c
+++ b/Src/parse.c
@@ -414,10 +414,10 @@ ecstrcode(char *s)
 	return c;
     } else {
 	Eccstr p, *pp;
-	int cmp;
+	long cmp;
 
 	for (pp = &ecstrs; (p = *pp); ) {
-	    if (!(cmp = p->nfunc - ecnfunc) && !(cmp = (((signed)p->hashval) - ((signed)val))) && !(cmp = strcmp(p->str, s))) {
+	    if (!(cmp = p->nfunc - ecnfunc) && !(cmp = (((long)p->hashval) - ((long)val))) && !(cmp = strcmp(p->str, s))) {
 		return p->offs;
             }
 	    pp = (cmp < 0 ? &(p->left) : &(p->right));