aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/termptyesc.c
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2015-11-08 12:49:08 +0100
committerBoris Faure <billiob@gmail.com>2015-11-08 13:06:13 +0100
commit4913364a22c7b500d6c6b61ca801bbc451e65979 (patch)
tree2e395b7ff9b92497f169bf4d29a6107da12896c5 /src/bin/termptyesc.c
parentfuzz: shorten test case (diff)
downloadterminology-4913364a22c7b500d6c6b61ca801bbc451e65979.tar.gz
fix int overflow
Diffstat (limited to 'src/bin/termptyesc.c')
-rw-r--r--src/bin/termptyesc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/bin/termptyesc.c b/src/bin/termptyesc.c
index 1c67064..81ede2f 100644
--- a/src/bin/termptyesc.c
+++ b/src/bin/termptyesc.c
@@ -1,5 +1,6 @@
#include "private.h"
#include <Elementary.h>
+#include <stdint.h>
#include "termio.h"
#include "termpty.h"
#include "termptydbl.h"
@@ -100,6 +101,11 @@ _csi_arg_get(Eina_Unicode **ptr)
}
while ((*b >= '0') && (*b <= '9'))
{
+ if (sum > INT32_MAX/10 )
+ {
+ *ptr = NULL;
+ return 0;
+ }
sum *= 10;
sum += *b - '0';
b++;