sstate->dcerpc.dcerpchdrudp.if_vers = *(p + 60);
sstate->dcerpc.dcerpchdrudp.if_vers |= *(p + 61) << 8;
sstate->dcerpc.dcerpchdrudp.if_vers |= *(p + 62) << 16;
- sstate->dcerpc.dcerpchdrudp.if_vers |= *(p + 63) >> 24;
+ sstate->dcerpc.dcerpchdrudp.if_vers |= *(p + 63) << 24;
sstate->dcerpc.dcerpchdrudp.seqnum = *(p + 64);
sstate->dcerpc.dcerpchdrudp.seqnum |= *(p + 65) << 8;
sstate->dcerpc.dcerpchdrudp.seqnum |= *(p + 66) << 16;
sstate->smb2.MessageId = *(p + 24);
sstate->smb2.MessageId |= *(p + 25) << 8;
sstate->smb2.MessageId |= *(p + 26) << 16;
- sstate->smb2.MessageId |= *(p + 27) << 24;
+ sstate->smb2.MessageId |= (uint64_t) *(p + 27) << 24;
sstate->smb2.MessageId |= (uint64_t) *(p + 28) << 32;
sstate->smb2.MessageId |= (uint64_t) *(p + 29) << 40;
sstate->smb2.MessageId |= (uint64_t) *(p + 30) << 48;
sstate->smb2.SessionId = *(p + 40);
sstate->smb2.SessionId |= *(p + 41) << 8;
sstate->smb2.SessionId |= *(p + 42) << 16;
- sstate->smb2.SessionId |= *(p + 43) << 24;
+ sstate->smb2.SessionId |= (uint64_t) *(p + 43) << 24;
sstate->smb2.SessionId |= (uint64_t) *(p + 44) << 32;
sstate->smb2.SessionId |= (uint64_t) *(p + 45) << 40;
sstate->smb2.SessionId |= (uint64_t) *(p + 46) << 48;
sstate->smb2.MessageId = *(p++) << 16;
if (!(--input_len)) break;
case 31:
- sstate->smb2.MessageId = *(p++) << 24;
+ sstate->smb2.MessageId = (uint64_t) *(p++) << 24;
if (!(--input_len)) break;
case 32:
sstate->smb2.MessageId = (uint64_t) *(p++) << 32;
sstate->smb2.SessionId |= *(p++) << 16;
if (!(--input_len)) break;
case 47:
- sstate->smb2.SessionId |= *(p++) << 24;
+ sstate->smb2.SessionId |= (uint64_t) *(p++) << 24;
if (!(--input_len)) break;
case 48:
sstate->smb2.SessionId |= (uint64_t) *(p++) << 32;
/* get me the bugger who wrote this junk of a code :P */
if (pctmi == NULL) {
- if ( (temp = SCMalloc(sizeof(SCPerfClubTMInst))) == NULL)
+ if ( (temp = SCMalloc(sizeof(SCPerfClubTMInst))) == NULL) {
+ SCMutexUnlock(&sc_perf_op_ctx->pctmi_lock);
return 0;
+ }
memset(temp, 0, sizeof(SCPerfClubTMInst));
temp->size = 1;
temp->head = SCMalloc(sizeof(SCPerfContext **));
- if (temp->head == NULL)
+ if (temp->head == NULL) {
+ SCMutexUnlock(&sc_perf_op_ctx->pctmi_lock);
return 0;
+ }
temp->head[0] = pctx;
temp->tm_name = SCStrdup(tm_name);
pctmi->head = SCRealloc(pctmi->head,
(pctmi->size + 1) * sizeof(SCPerfContext **));
- if (pctmi->head == NULL)
+ if (pctmi->head == NULL) {
+ SCMutexUnlock(&sc_perf_op_ctx->pctmi_lock);
return 0;
+ }
hpctx = pctmi->head;
hpctx[pctmi->size] = pctx;
SigMatch *DetectByteExtractRetrieveSMVar(const char *arg, Signature *s, int list)
{
+ if (list == -1)
+ return NULL;
+
DetectByteExtractData *bed = NULL;
SigMatch *sm = s->sm_lists[list];
sm = sm->next;
}
- if (type != DETECT_FLOWVAR_NOT_USED)
- return type;
-
sm = sig->sm_lists[DETECT_SM_LIST_MATCH];
pd = NULL;
while (sm != NULL) {
sm = sm->next;
}
- if (type != DETECT_PKTVAR_NOT_USED)
- return type;
-
sm = sig->sm_lists[DETECT_SM_LIST_MATCH];
pd = NULL;
while (sm != NULL) {
return 1;
}
- if ( (thread_list_temp = SCMalloc(sizeof(SCLogFDFilterThreadList))) == NULL)
+ if ( (thread_list_temp = SCMalloc(sizeof(SCLogFDFilterThreadList))) == NULL) {
+ SCMutexUnlock(&sc_log_fd_filters_tl_m);
return 0;
+ }
memset(thread_list_temp, 0, sizeof(SCLogFDFilterThreadList));
thread_list_temp->t = self;
op_ifaces_ctx = SCLogInitSyslogOPIface(SCMapEnumNameToValue(s, SCSyslogGetFacilityMap()), NULL, -1);
break;
- default:
- break;
}
sc_lc->op_ifaces = op_ifaces_ctx;
sc_lc->op_ifaces_cnt++;
op_ifaces_ctx = SCLogInitSyslogOPIface(SCMapEnumNameToValue(s, SCSyslogGetFacilityMap()), NULL, -1);
break;
- default:
- break;
}
sc_lc->op_ifaces = op_ifaces_ctx;