changeset 35883:804c3926503b

Fix a potential integer overflow.
author reimar
date Sat, 16 Mar 2013 10:32:42 +0000
parents 6bdb39d9a114
children edd8273dc025
files sub/unrar_exec.c
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/sub/unrar_exec.c	Sat Mar 16 10:15:07 2013 +0000
+++ b/sub/unrar_exec.c	Sat Mar 16 10:32:42 2013 +0000
@@ -116,6 +116,8 @@
         *size += bytesread;
         if (*size == bufsize) {
             char *p;
+            if (bufsize >= 0x7fffffff - ALLOC_INCR)
+                break;
             bufsize += ALLOC_INCR;
             p = realloc(*output, bufsize);
             if (!p)