]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
mime-decode: remove "comparison between signed and unsigned integer expressions"
authorTom DeCanio <decanio.tom@gmail.com>
Thu, 9 Oct 2014 19:23:09 +0000 (12:23 -0700)
committerVictor Julien <victor@inliniac.net>
Thu, 30 Oct 2014 12:33:53 +0000 (13:33 +0100)
warnings

src/mime-decode.c

index 6332ff1450f4b5055579b98edd47a525109f52e5..a1f8b226ca9faa7bb8f621483771ee412893c260 100644 (file)
@@ -872,7 +872,7 @@ static int IsExeUrl(char *url, uint32_t len) {
     for (i = 0; UrlExeExts[i] != NULL; i++) {
         extLen = strlen(UrlExeExts[i]);
         ext = FindString(url, len, UrlExeExts[i]);
-        if (ext != NULL && (ext + extLen - url == len || ext[extLen] == '?')) {
+        if (ext != NULL && (ext + extLen - url == (int)len || ext[extLen] == '?')) {
             isExeUrl = 1;
             break;
         }
@@ -1145,7 +1145,7 @@ static int ProcessDecodedDataChunk(const uint8_t *chunk, uint32_t len,
                             /* If last token found without CR/LF delimiter, then save
                              * and reconstruct with next chunk
                              */
-                            if (tok + tokLen - (char *) chunk == len) {
+                            if (tok + tokLen - (char *) chunk == (int)len) {
                                 PrintChars(SC_LOG_DEBUG, "LAST CHUNK LINE - CUTOFF",
                                         tok, tokLen);
                                 SCLogDebug("\nCHUNK CUTOFF CHARS: %d delim %ld\n", tokLen, len - (tok + tokLen - (char *) chunk));
@@ -1159,7 +1159,7 @@ static int ProcessDecodedDataChunk(const uint8_t *chunk, uint32_t len,
                                 }
                             }
                         }
-                    } while (tok != remainPtr && remainPtr - (char *) chunk < len);
+                    } while (tok != remainPtr && remainPtr - (char *) chunk < (int)len);
                 }
             }
         }
@@ -1671,14 +1671,14 @@ static int FindMimeHeader(const char *buf, uint32_t blen,
 
         /* Value starts after 'header:' (normalize spaces) */
         hval = hname + hlen + 1;
-        if (hval - buf >= blen) {
+        if (hval - buf >= (int)blen) {
             SCLogDebug("No Header value found");
             hval = NULL;
         } else {
             while (hval[0] == ' ') {
 
                 /* If last character before end of bounds, set to NULL */
-                if (hval - buf >= blen - 1) {
+                if (hval - buf >= (int)blen - 1) {
                     SCLogDebug("No Header value found");
                     hval = NULL;
                     break;
@@ -2542,7 +2542,7 @@ MimeDecEntity * MimeDecParseFullMsg(const char *buf, uint32_t blen, void *data,
             }
         }
 
-    } while (tok != remainPtr && remainPtr - buf < blen);
+    } while (tok != remainPtr && remainPtr - buf < (int)blen);
 
     if (ret == MIME_DEC_OK) {
         SCLogDebug("Message parser was successful");