From e0c80300c2e6ade197b7e621396c1303802f2b55 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Sat, 21 Oct 2017 17:24:11 -0600 Subject: [PATCH] regcomp.c: Add assertion If this value is negative, something is wrong. --- regcomp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/regcomp.c b/regcomp.c index 18e87e1..95c3afc 100644 --- a/regcomp.c +++ b/regcomp.c @@ -628,7 +628,7 @@ static const scan_data_t zero_scan_data = { UTF8fARG(UTF, \ (xI(xC) > eC) /* Don't run off end */ \ ? eC - sC /* Length before the <--HERE */ \ - : xI_offset(xC), \ + : ( __ASSERT_(xI_offset(xC) >= 0) xI_offset(xC) ), \ sC), /* The input pattern printed up to the <--HERE */ \ UTF8fARG(UTF, \ (xI(xC) > eC) ? 0 : eC - xI(xC), /* Length after <--HERE */ \ -- 1.8.3.1