From e661a86353e11592c7ed6a847e19a83609f49e77 Mon Sep 17 00:00:00 2001 From: "djm@openbsd.org" Date: Mon, 4 May 2015 06:10:48 +0000 Subject: upstream commit Remove pattern length argument from match_pattern_list(), we only ever use it for strlen(pattern). Prompted by hanno AT hboeck.de pointing an out-of-bound read error caused by an incorrect pattern length found using AFL and his own tools. ok markus@ --- compat.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'compat.c') diff --git a/compat.c b/compat.c index 7836a86be..337bbe01e 100644 --- a/compat.c +++ b/compat.c @@ -192,8 +192,7 @@ compat_datafellows(const char *version) /* process table, return first match */ for (i = 0; check[i].pat; i++) { - if (match_pattern_list(version, check[i].pat, - strlen(check[i].pat), 0) == 1) { + if (match_pattern_list(version, check[i].pat, 0) == 1) { debug("match: %s pat %s compat 0x%08x", version, check[i].pat, check[i].bugs); datafellows = check[i].bugs; /* XXX for now */ @@ -251,7 +250,7 @@ filter_proposal(char *proposal, const char *filter) buffer_init(&b); tmp = orig_prop = xstrdup(proposal); while ((cp = strsep(&tmp, ",")) != NULL) { - if (match_pattern_list(cp, filter, strlen(cp), 0) != 1) { + if (match_pattern_list(cp, filter, 0) != 1) { if (buffer_len(&b) > 0) buffer_append(&b, ",", 1); buffer_append(&b, cp, strlen(cp)); -- cgit v1.2.3