[evolution-data-server] Bug 735344 - camel: Fix potential integer overflow found by Coverity scan



commit 9f9e6c3595608b449fc903c11c3c97a46fca2cc1
Author: Philip Withnall <philip withnall collabora co uk>
Date:   Mon Sep 8 16:11:35 2014 +0200

    Bug 735344 - camel: Fix potential integer overflow found by Coverity scan
    
    The headerlen is the difference between two pointers, so needs to be a
    gintptr. Found by Coverity.
    
    Coverity issue: #1061266

 camel/camel-mime-parser.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/camel/camel-mime-parser.c b/camel/camel-mime-parser.c
index c461361..5a4fa2c 100644
--- a/camel/camel-mime-parser.c
+++ b/camel/camel-mime-parser.c
@@ -1223,12 +1223,12 @@ header_append_mempool (struct _header_scan_state *s,
 /* Basically an optimised version of g_byte_array_append() */
 #define header_append(s, start, inptr) \
 { \
-       register gint headerlen = inptr - start; \
+       register gintptr headerlen = inptr - start; \
  \
        if (headerlen > 0) { \
                if (headerlen >= (s->outend - s->outptr)) { \
                        register gchar *outnew; \
-                       register gint olen = ((s->outend - s->outbuf) + headerlen) * 2 + 1; \
+                       register gintptr olen = ((s->outend - s->outbuf) + headerlen) * 2 + 1; \
                        outnew = g_realloc (s->outbuf, olen); \
                        s->outptr = s->outptr - s->outbuf + outnew; \
                        s->outbuf = outnew; \


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]