apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe Jr." <wr...@rowe-clan.net>
Subject Re: [PATCH] charclass matching and input check for fnmatch
Date Tue, 06 Dec 2011 20:48:26 GMT
On 12/6/2011 4:36 AM, Stefan Sperling wrote:
> @@ -207,6 +274,10 @@ APR_DECLARE(int) apr_fnmatch(const char *pattern,
>      const char *mismatch = NULL;
>      int matchlen = 0;
>  
> +    if (strnlen(pattern, APR_PATH_MAX) == APR_PATH_MAX ||
> +        strnlen(string, APR_PATH_MAX) == APR_PATH_MAX)
> +            return (APR_FNM_NOMATCH);
> +

I'm not certain if we can presume strnlen() without a feature
test?  Also I'd benchmark this against comparing the offset to
a max offset in the code... numeric vs string pre-counting.

Mime
View raw message