Project

General

Profile

Bug #79 » 0005-signed-unsigned-comparision-cleanup.patch

Kirby Kuehl, 02/08/2010 09:33 AM

View differences:

src/app-layer-dcerpc-common.h
uint32_t call_id; /* 12:04 call identifier */
}DCERPCHdr;
#define DCERPC_HDR_LEN 16
#define DCERPC_HDR_LEN 16U
struct uuid_entry {
uint16_t ctxid;
src/app-layer-nbss.h
uint8_t flags;
uint32_t length;
}NBSSHdr;
#define NBSS_HDR_LEN 4
#define NBSS_HDR_LEN 4U
#endif /* APPLAYERNBSS_H_ */
src/app-layer-smb.c
SMBState *sstate = (SMBState *) smb_state;
uint8_t *p = input;
/* Check for validity of dataoffset */
if ((uint16_t)(sstate->bytesprocessed - NBSS_HDR_LEN) > sstate->andx.dataoffset) {
if ((sstate->bytesprocessed - NBSS_HDR_LEN) > sstate->andx.dataoffset) {
sstate->andx.paddingparsed = 1;
SCReturnUInt((uint32_t)(p - input));
}
while ((uint32_t) ((sstate->bytesprocessed - NBSS_HDR_LEN) + (p - input))
while (((sstate->bytesprocessed - NBSS_HDR_LEN) + (p - input))
< sstate->andx.dataoffset && sstate->bytecount.bytecountleft--
&& input_len--) {
SCLogDebug("0x%02x ", *p);
p++;
}
if ((uint32_t) ((sstate->bytesprocessed - NBSS_HDR_LEN) + (p - input))
if (((sstate->bytesprocessed - NBSS_HDR_LEN) + (p - input))
== sstate->andx.dataoffset) {
sstate->andx.paddingparsed = 1;
}
src/app-layer-smb.h
uint16_t uid;
uint16_t mid;
}SMBHdr;
#define SMB_HDR_LEN 32
#define MINIMUM_SMB_LEN 35
#define NBSS_SMB_HDRS_LEN 36
#define SMB_HDR_LEN 32U
#define MINIMUM_SMB_LEN 35U
#define NBSS_SMB_HDRS_LEN 36U
typedef struct wordcount_ {
uint8_t wordcount;
(5-5/5)