mime-decode: remove "comparison between signed and unsigned integer expressions"

warnings
pull/1195/head
Tom DeCanio 11 years ago committed by Victor Julien
parent e5c36952d6
commit 1ab5f72fdd

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

Loading…
Cancel
Save