summaryrefslogtreecommitdiff
path: root/groupaccess.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 /groupaccess.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 'groupaccess.c')
-rw-r--r--groupaccess.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/groupaccess.c b/groupaccess.c
index 4fca04471..2518c8487 100644
--- a/groupaccess.c
+++ b/groupaccess.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: groupaccess.c,v 1.15 2015/01/20 23:14:00 deraadt Exp $ */ 1/* $OpenBSD: groupaccess.c,v 1.16 2015/05/04 06:10:48 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2001 Kevin Steves. All rights reserved. 3 * Copyright (c) 2001 Kevin Steves. All rights reserved.
4 * 4 *
@@ -97,11 +97,9 @@ int
97ga_match_pattern_list(const char *group_pattern) 97ga_match_pattern_list(const char *group_pattern)
98{ 98{
99 int i, found = 0; 99 int i, found = 0;
100 size_t len = strlen(group_pattern);
101 100
102 for (i = 0; i < ngroups; i++) { 101 for (i = 0; i < ngroups; i++) {
103 switch (match_pattern_list(groups_byname[i], 102 switch (match_pattern_list(groups_byname[i], group_pattern, 0)) {
104 group_pattern, len, 0)) {
105 case -1: 103 case -1:
106 return 0; /* Negated match wins */ 104 return 0; /* Negated match wins */
107 case 0: 105 case 0: