From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-6.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id D72BC1F670 for ; Wed, 20 Oct 2021 15:12:34 +0000 (UTC) Received: from localhost ([::1]:44530 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mdDGb-0002iD-J9 for normalperson@yhbt.net; Wed, 20 Oct 2021 11:12:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59314) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mdDGY-0002fI-1v for bug-gnulib@gnu.org; Wed, 20 Oct 2021 11:12:30 -0400 Received: from mail-ua1-x931.google.com ([2607:f8b0:4864:20::931]:39847) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mdDGW-0003EF-0k for bug-gnulib@gnu.org; Wed, 20 Oct 2021 11:12:29 -0400 Received: by mail-ua1-x931.google.com with SMTP id f3so7245224uap.6 for ; Wed, 20 Oct 2021 08:12:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=k0ZuWgIArRcO2m+gPZ/A+30rM3OetJuCBLSX1pN4tZI=; b=k8roC82hPJ8lN051SftAsPsKhZuWRIPHOKaXkbSUfiYnD0MUQR5cbGwDXV/8D5EWzo SZ2KsHLcvrGjCXsLhdtievY9nD/j27KkV7r/mxvTDljczhwVUGWyRrexeaZbRA7HTwdx PD+/6gHMChQ+o/1E11ew23lg8NyPNJV1A0on3+yRxpxXFt46wUW2ITyVLuAKXDkdoCC+ FPHwUlMrU1ZvEiB9OloeRbLequ220oD7bmf4H1L1geKZE7qmMCGMlwpfIy8g6RGRGfzF 5DJ26GN9lhOUh/unkf4pfX3IerDRCVbeqoX+S1KZNTUlN5z4f3kidWw/6XT5o81BRtNy cTBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=k0ZuWgIArRcO2m+gPZ/A+30rM3OetJuCBLSX1pN4tZI=; b=LQSV6eNFPM4csWPCAT//WFPuCI0Qxvlr4n12sRVOThv0R7VO+AQbX6orta8/bY5r68 vR6bdEKaMmiVsQokNjgYN4hV5Gsfmrm8AIaEJ1v4xz61qD7OxrP/YuCwe4koNscgLBXw o95O2Rx1GRlIsHAW+kbWpuiv4tJz4+2zUCRAytPvbXC3lfAW/2ByLf15CBCqR0WpJEgc I7Lqb0Ru0tkLxlwwkD68mUFe6sQWgPtixkyls90DUO328p0gjhicftZBoCoyqzriipkf 5e6Ul3n9Ukg3XPM2feBIeSDIQC7Y9O8/e4tTO3pnVuhrJrVF1gkTwqAKfltjzx6dXyQq TEww== X-Gm-Message-State: AOAM533B9m4XEbkT9L5LbWRNktE3WqxSFNFwMS0bZjjoI8qKKoaLPz1x cI0nHaM51iJK87xxeLFK6amdew== X-Google-Smtp-Source: ABdhPJzh63HAO0C9gCNu7R04OD1Ma6TFYSYGWsvqBTgrul0an28MgwW6VMCtAaXSUso/wjoEu2Vbhw== X-Received: by 2002:ab0:3d06:: with SMTP id f6mr173719uax.65.1634742746617; Wed, 20 Oct 2021 08:12:26 -0700 (PDT) Received: from ?IPV6:2804:431:c7ca:2654:6d0a:89c6:4739:ceb5? ([2804:431:c7ca:2654:6d0a:89c6:4739:ceb5]) by smtp.gmail.com with ESMTPSA id l10sm1363361vsj.27.2021.10.20.08.12.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 20 Oct 2021 08:12:26 -0700 (PDT) Message-ID: Date: Wed, 20 Oct 2021 12:12:24 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.2 Subject: Re: [PATCH 2/2] posix: Remove alloca usage for internal fnmatch implementation Content-Language: en-US To: Florian Weimer , Adhemerval Zanella via Libc-alpha References: <20210104202528.1228255-1-adhemerval.zanella@linaro.org> <20210104202528.1228255-2-adhemerval.zanella@linaro.org> <87h7ller7l.fsf@oldenburg.str.redhat.com> From: Adhemerval Zanella In-Reply-To: <87h7ller7l.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2607:f8b0:4864:20::931; envelope-from=adhemerval.zanella@linaro.org; helo=mail-ua1-x931.google.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-2.267, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paul Eggert , bug-gnulib@gnu.org Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" On 08/03/2021 09:59, Florian Weimer wrote: > * 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. Hi Florian, I noted this patch [1] is marked accepted, was you the one that accepted it? In any case, are you still ok with the change? [1] https://patchwork.sourceware.org/project/glibc/patch/20210202130804.1920933-2-adhemerval.zanella@linaro.org/