Fix segv when testing for sid 2002181

remotes/origin/master-1.0.x
Victor Julien 16 years ago
parent 69eb869cc9
commit fa5dbaeb1d

@ -284,8 +284,8 @@ int TestWithinDistanceOffsetDepth(ThreadVars *t,
return -1; return -1;
} else { } else {
return TestWithinDistanceOffsetDepth(t, det_ctx, nm, return TestWithinDistanceOffsetDepth(t, det_ctx, nm,
nsm, nsm->next, nsm, DetectContentFindNextApplicableSM(nsm),
pktoff); pktoff);
} }
} }
} else { } else {
@ -748,8 +748,12 @@ void DetectContentPrint(DetectContentData *cd)
char *tmpstr=malloc(sizeof(char) * cd->content_len + 1); char *tmpstr=malloc(sizeof(char) * cd->content_len + 1);
if (tmpstr != NULL) { if (tmpstr != NULL) {
for (i = 0; i < cd->content_len; i++) for (i = 0; i < cd->content_len; i++) {
tmpstr[i] = cd->content[i]; if (isprint(cd->content[i]))
tmpstr[i] = cd->content[i];
else
tmpstr[i] = '.';
}
tmpstr[i] = '\0'; tmpstr[i] = '\0';
SCLogDebug("Content: \"%s\"", tmpstr); SCLogDebug("Content: \"%s\"", tmpstr);
free(tmpstr); free(tmpstr);
@ -1458,7 +1462,7 @@ int DetectContentSetup (DetectEngineCtx *de_ctx, Signature *s, SigMatch *m, char
if (aux->chunk_id == 0) if (aux->chunk_id == 0)
first = sm; first = sm;
DetectContentPropagateModifiers(first); DetectContentPropagateModifiers(first);
//DetectContentPrint(aux); DetectContentPrint(aux);
} }
/** Free the original pattern */ /** Free the original pattern */
@ -1492,7 +1496,7 @@ int DetectContentSetup (DetectEngineCtx *de_ctx, Signature *s, SigMatch *m, char
if (cd->negated == 1) if (cd->negated == 1)
s->flags |= SIG_FLAG_MPM_NEGCONTENT; s->flags |= SIG_FLAG_MPM_NEGCONTENT;
//DetectContentPrint(cd); DetectContentPrint(cd);
} }
return 0; return 0;

Loading…
Cancel
Save