* Adhemerval Zanella via Libc-alpha:

> -    else if (*p == L_('|'))
> +    else if (*p == L_(')') || *p == L_('|'))
>        {
>          if (level == 0)
>            {
> -            NEW_PATTERN;
> -            startp = p + 1;
> +            size_t slen = opt == L_('?') || opt == L_('@')
> +                       ? pattern_len : p - startp + 1;
> +            CHAR *newp = malloc (slen * sizeof (CHAR));
> +            if (newp != NULL)
> +              {
> +                *((CHAR *) MEMPCPY (newp, startp, p - startp)) = L_('\0');
> +                PASTE (PATTERN_PREFIX,_add) (&list, newp);
> +              }
> +            if (newp == NULL || PASTE (PATTERN_PREFIX, _has_failed) (&list))
> +              {
> +                retval = -2;
> +                goto out;
> +              }
> +
> +            if (*p == L_('|'))
> +              startp = p + 1;
>            }

slen seems to be the wrong variable name.  But I don't know wh the
original code computes plen conditionally and then uses p - startp
unconditionally.  That seems wrong.  The discrepancy goes back to
821a6bb4360.  Do you see a case where the difference matters?

The == 0 checks for the recursive FCT calls are wrong because they treat
match failure the same as OOM and other errors (the -2 return value),
but that also is a pre-existing issue.

The conversation itself appears to be faithful.

Thanks,
Florian


Reply via email to