From 4827a4dcef52cbe2f6d1de98e1295afec5f41b79 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Mon, 16 Sep 2013 18:15:49 +0200 Subject: [PATCH] Coverity 400477: pcre_get_substring retval Add missing return code check to pcre_get_substring call. --- src/detect-parse.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/detect-parse.c b/src/detect-parse.c index ff985b12e4..85c7fbc6e5 100644 --- a/src/detect-parse.c +++ b/src/detect-parse.c @@ -768,7 +768,8 @@ static int SigParseBasics(Signature *s, char *sigstr, char ***result, uint8_t ad } for (i = 1; i <= ret - 1; i++) { - pcre_get_substring(sigstr, ov, MAX_SUBSTRINGS, i, &arr[i - 1]); + if (pcre_get_substring(sigstr, ov, MAX_SUBSTRINGS, i, &arr[i - 1]) < 0) + goto error; //printf("SigParseBasics: arr[%" PRId32 "] = \"%s\"\n", i-1, arr[i-1]); } arr[i - 1] = NULL;