summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2020-07-22 19:20:41 +0000
committermillert <millert@openbsd.org>2020-07-22 19:20:41 +0000
commit0db84b276ea19ea515379ad902f706bb06756ada (patch)
tree33ec7b882cf27daa8fdfce5a1b59697d3ab20649 /bin
parentDon't grab the kernel lock for mpsafe interrupts. (diff)
downloadwireguard-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.c5
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--;