[patch] Fix BZ 18036 buffer overflow (read past end of buffer) in internal_fnmatch=>end_pattern

Florian Weimer fweimer@redhat.com
Mon Mar 2 13:18:00 GMT 2015


On 02/28/2015 06:25 AM, Paul Pluzhnikov wrote:
>      else if ((*p == L('?') || *p == L('*') || *p == L('+') || *p == L('@')
>  	      || *p == L('!')) && p[1] == L('('))
> -      p = END (p + 1);
> +      {
> +	p = END (p + 1);
> +	if (*p == L('\0'))
> +	  /* This is an invalid pattern.  */
> +	  return pattern;
> +      }

Okay to commit if you have checked that the test case actually tests the
bug.  Thanks.

-- 
Florian Weimer / Red Hat Product Security



More information about the Libc-alpha mailing list