bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: quotearg test failures


From: Padraig Brady
Subject: Re: quotearg test failures
Date: Tue, 18 Oct 2016 13:43:35 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0

On 10/18/2016 05:15 AM, Bruno Haible wrote:
>
> How about this? You are doing multiple passes through the argument string
> anyway now. (Originally quotearg was meant as a single-pass implementation,
> but it isn't any more.) So
>   - remove the code block of lines 711..720,
>   - instead, before the for(...) loop, determine all_c_and_shell_quote_compat
>     and encountered_single_quote in an extra single pass through the string,
>   - and put the code block from lines 711..720 *BEFORE* the for(...) loop.
>       
> This way, the buffer will only be filled once. => No buffer overrun.
>
> I'm reverting the unintented parts of test-sh-quote.c. You can then decide
> how you want to modify quotearg.c (and sh-quote.c if you want).

In the attached I added a single extra orig_buffersize variable to
control an extra read-only scan.

Pádraig.

Attachment: fix-sh-quote.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]