diff options
author | Reyk Floeter <reyk@esdenera.com> | 2015-06-22 13:55:51 +0200 |
---|---|---|
committer | Reyk Floeter <reyk@esdenera.com> | 2015-06-22 13:55:51 +0200 |
commit | a6ac783e163ccffbcd2d28627497a7bb31a9dd3b (patch) | |
tree | 285cd2503740d41e07da91b01906b65263257061 /httpd/patterns.c | |
parent | 78ab0835f18d0902a86e7f877530780a7b3c0370 (diff) | |
parent | 2299e23aa218795bb32fc643b272f80fb103ac29 (diff) | |
download | httpd-a6ac783e163ccffbcd2d28627497a7bb31a9dd3b.tar.gz httpd-a6ac783e163ccffbcd2d28627497a7bb31a9dd3b.zip |
Merge branch 'semarie-patterns' into patterns
Diffstat (limited to 'httpd/patterns.c')
-rw-r--r-- | httpd/patterns.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/httpd/patterns.c b/httpd/patterns.c index 8fbaa28..1dbea15 100644 --- a/httpd/patterns.c +++ b/httpd/patterns.c @@ -215,7 +215,7 @@ matchbalance(struct match_state *ms, const char *s, const char *p) { if (p >= ms->p_end - 1) { match_error(ms, - "malformed pattern (missing arguments to '%%b')"); + "malformed pattern (missing arguments to '%b')"); return (NULL); } if (*s != *p) @@ -308,6 +308,8 @@ match_capture(struct match_state *ms, const char *s, int l) { size_t len; l = check_capture(ms, l); + if (l == -1) + return NULL; len = ms->capture[l].len; if ((size_t) (ms->src_end - s) >= len && memcmp(ms->capture[l].init, s, len) == 0) @@ -370,7 +372,7 @@ match(struct match_state *ms, const char *s, const char *p) p += 2; if (*p != '[') { match_error(ms, "missing '['" - " after '%%f' in pattern"); + " after '%f' in pattern"); break; } /* points to what is next */ @@ -667,7 +669,7 @@ str_match(const char *string, const char *pattern, struct str_match *m, ret = str_find_aux(&ms, pattern, string, sm, nsm, 0); if (ret == 0 || ms.error != NULL) { - /* Return 0 on error and store the error string */ + /* Return -1 on error and store the error string */ *errstr = ms.error; return (-1); } |