diff options
author | millert <millert@openbsd.org> | 2020-07-22 19:20:41 +0000 |
---|---|---|
committer | millert <millert@openbsd.org> | 2020-07-22 19:20:41 +0000 |
commit | 0db84b276ea19ea515379ad902f706bb06756ada (patch) | |
tree | 33ec7b882cf27daa8fdfce5a1b59697d3ab20649 /bin | |
parent | Don't grab the kernel lock for mpsafe interrupts. (diff) | |
download | wireguard-openbsd-0db84b276ea19ea515379ad902f706bb06756ada.tar.xz wireguard-openbsd-0db84b276ea19ea515379ad902f706bb06756ada.zip |
Collapse consecutive stars to avoid exponential behavior.
OK tb@
Diffstat (limited to 'bin')
-rw-r--r-- | bin/ksh/misc.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/bin/ksh/misc.c b/bin/ksh/misc.c index 7b5889f2a27..9e6e9db5e76 100644 --- a/bin/ksh/misc.c +++ b/bin/ksh/misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: misc.c,v 1.74 2020/07/07 10:33:58 jca Exp $ */ +/* $OpenBSD: misc.c,v 1.75 2020/07/22 19:20:41 millert Exp $ */ /* * Miscellaneous functions @@ -615,6 +615,9 @@ do_gmatch(const unsigned char *s, const unsigned char *se, break; case '*': + /* collapse consecutive stars */ + while (ISMAGIC(p[0]) && p[1] == '*') + p += 2; if (p == pe) return 1; s--; |