fix int overflow

This commit is contained in:
Boris Faure 2015-11-08 12:49:08 +01:00
parent bbd9f66d1e
commit 4913364a22
1 changed files with 6 additions and 0 deletions

View File

@ -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++;