detect-dce-opnum: add sanity check

Specifying the option dce_opnum without value was triggering a
segfault.
pull/1171/head
Eric Leblond 12 years ago committed by Victor Julien
parent 2c9c0f1e8f
commit 9a36f7f633

@ -142,6 +142,10 @@ static inline DetectDceOpnumData *DetectDceOpnumArgParse(const char *arg)
char *comma_token = NULL;
char *hyphen_token = NULL;
if (arg == NULL) {
goto error;
}
ret = pcre_exec(parse_regex, parse_regex_study, arg, strlen(arg), 0, 0, ov,
MAX_SUBSTRINGS);
if (ret < 2) {
@ -306,6 +310,12 @@ static int DetectDceOpnumSetup(DetectEngineCtx *de_ctx, Signature *s, char *arg)
DetectDceOpnumData *dod = NULL;
SigMatch *sm = NULL;
if (arg == NULL) {
SCLogError(SC_ERR_INVALID_SIGNATURE, "Error parsing dce_opnum option in "
"signature, option needs a value");
goto error;
}
dod = DetectDceOpnumArgParse(arg);
if (dod == NULL) {
SCLogError(SC_ERR_INVALID_SIGNATURE, "Error parsing dce_opnum option in "

Loading…
Cancel
Save