summaryrefslogtreecommitdiff
path: root/compat.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2015-05-04 06:10:48 +0000
committerDamien Miller <djm@mindrot.org>2015-05-10 11:38:04 +1000
commite661a86353e11592c7ed6a847e19a83609f49e77 (patch)
tree5fe2c206d56dd4296a79e20ca6cfbbb83cb7c40c /compat.c
parent0ef1de742be2ee4b10381193fe90730925b7f027 (diff)
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@
Diffstat (limited to 'compat.c')
-rw-r--r--compat.c5
1 files changed, 2 insertions, 3 deletions
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)
192 192
193 /* process table, return first match */ 193 /* process table, return first match */
194 for (i = 0; check[i].pat; i++) { 194 for (i = 0; check[i].pat; i++) {
195 if (match_pattern_list(version, check[i].pat, 195 if (match_pattern_list(version, check[i].pat, 0) == 1) {
196 strlen(check[i].pat), 0) == 1) {
197 debug("match: %s pat %s compat 0x%08x", 196 debug("match: %s pat %s compat 0x%08x",
198 version, check[i].pat, check[i].bugs); 197 version, check[i].pat, check[i].bugs);
199 datafellows = check[i].bugs; /* XXX for now */ 198 datafellows = check[i].bugs; /* XXX for now */
@@ -251,7 +250,7 @@ filter_proposal(char *proposal, const char *filter)
251 buffer_init(&b); 250 buffer_init(&b);
252 tmp = orig_prop = xstrdup(proposal); 251 tmp = orig_prop = xstrdup(proposal);
253 while ((cp = strsep(&tmp, ",")) != NULL) { 252 while ((cp = strsep(&tmp, ",")) != NULL) {
254 if (match_pattern_list(cp, filter, strlen(cp), 0) != 1) { 253 if (match_pattern_list(cp, filter, 0) != 1) {
255 if (buffer_len(&b) > 0) 254 if (buffer_len(&b) > 0)
256 buffer_append(&b, ",", 1); 255 buffer_append(&b, ",", 1);
257 buffer_append(&b, cp, strlen(cp)); 256 buffer_append(&b, cp, strlen(cp));