summaryrefslogtreecommitdiff
path: root/src/lib/eet
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-07-11 21:54:57 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-07-11 21:54:57 +0900
commit679af3271fbc577602fded804dee6fe59748178f (patch)
tree8b1158fab962ec03fbcf48e3e2a5fc9d11596158 /src/lib/eet
parent98a02fc17c8d630068684385f74787bfc26183cf (diff)
eet - fix possible integer overflow in ptr diff on parse
coverity spotted this - with silly long strings (like 1gb in size or+) it might happen. fix CID 1256196
Diffstat (limited to 'src/lib/eet')
-rw-r--r--src/lib/eet/eet_lib.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/eet/eet_lib.c b/src/lib/eet/eet_lib.c
index 4d0dfbae5d..d2c95c220c 100644
--- a/src/lib/eet/eet_lib.c
+++ b/src/lib/eet/eet_lib.c
@@ -1757,7 +1757,9 @@ _base64_dec(const char *file, int *size_ret)
1757 } 1757 }
1758 end = p; 1758 end = p;
1759 // go from line start to (but not including) first invalid char 1759 // go from line start to (but not including) first invalid char
1760 if (((end - buf) > 0) && (((end - buf) % 4) == 0)) 1760 if (((end - buf) > 0) &&
1761 ((end - buf) < 0x1fffffff) && // not too long
1762 (((end - buf) % 4) == 0))
1761 { 1763 {
1762 unsigned char *tmp = malloc((end - buf + 4) * 2); 1764 unsigned char *tmp = malloc((end - buf + 4) * 2);
1763 1765