From c9765125966bd337b9538979c1b56e4c6279ab6c Mon Sep 17 00:00:00 2001 From: "K.Kosako" Date: Wed, 28 Feb 2018 16:04:27 +0900 Subject: [PATCH] don't allow empty tag definition --- src/regparse.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/regparse.c b/src/regparse.c index 2715a06..5ae4937 100644 --- a/src/regparse.c +++ b/src/regparse.c @@ -6682,7 +6682,11 @@ parse_callout_of_name(Node** np, int cterm, UChar** src, UChar* end, ScanEnv* en while (! PEND) { tag_end = p; PFETCH_S(c); - if (c == ']') break; + if (c == ']') { + if (tag_end == tag_start) + return ONIGERR_INVALID_CALLOUT_TAG_NAME; + break; + } if (c > 255) return ONIGERR_INVALID_CALLOUT_TAG_NAME; if (! ONIGENC_IS_CODE_ALNUM(enc, c) && c != '_') return ONIGERR_INVALID_CALLOUT_TAG_NAME; -- 2.40.0