Hello,
On Wed, Aug 06, 2025 at 02:52:37PM +0300, [email protected] wrote:
> From: Nikita Kurashkin <[email protected]>
>
> Fix a parsing issue where empty ACL arguments inside braces were not detected,
> causing misleading errors like "missing closing '}' in condition".
>
> 1) The while loop condition was modified: instead of checking the first
> character of the string (*args[arg_end]), it now checks for the existence of
> the string pointer (args[arg_end]).
> This allows the loop to enter empty strings for further handling.
> 2) Inside the loop, an explicit check for empty strings (if (*args[arg_end]
> == '\0')) was added, which triggers an error and aborts processing.
> 3) After the loop, an additional check for the presence and non-emptiness of
> the argument was added to replace the previous first-character check removed
> from the while condition.
> This change prevents compiler warnings about potential NULL dereferencing.
> 4) Added a test case to the configuration file to cover the scenario of an
> empty ACL argument within {}.
Thanks for your patch, but what version are you running on ? Here on
latest master, your config gives me this:
[WARNING] (2908) : config : parsing [/dev/shm/empty.cfg:2]: argument number
5 at position 34 is empty and marks the end of the argument list; all
subsequent arguments will be ignored:
http-request deny if { path_dir '' }
^
[ALERT] (2908) : config : parsing [/dev/shm/empty.cfg:2] : error detected
while parsing an 'http-request deny' condition : missing closing '}' in
condition.
Or are you simply trying to make that error clearer ? In this case, do
you find that the warning + error above is not clear enough and we could
improve it ? I'm asking because trying to fix it in the lowest layers is
a rathole we'd rather avoid as it can bring us quite far.
Thanks!
Willy