[mod_redirect,mod_rewrite] fix segfault w/ invalid syntax (fixes
(thx nti)
x-ref:
"Segmentation fault with invalid lighttpd.conf syntax"
@@ -122,7 +122,7 @@ static void pcre_keyvalue_buffer_append_match(buffer *b, const char **list, int
static void pcre_keyvalue_buffer_append_ctxmatch(buffer *b, pcre_keyvalue_ctx *ctx, unsigned int num, int flags) {
const struct cond_cache_t * const cache = ctx->cache;
if (!cache) return; /* no enclosing match context */
- if (num < (unsigned int)cache->patterncount) {
+ if ((int)num < cache->patterncount) {
const int off = cache->matches[(num <<= 1)]; /*(num *= 2)*/
const int len = cache->matches[num+1] - off;
burl_append(b, cache->comp_value->ptr + off, (size_t)len, flags);
