mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-02-04 23:30:33 +01:00
is_valid_section_name: Fix logical expression
Group names in desktop files may contain all ASCII characters, except
control characters and '[' and ']'. Rather than accepting all values,
thanks to a logical operator confusion found by GCC warning
-Wlogical-op, instead explicitly reject the invalid values.
Signed-off-by: David King <dking@redhat.com>
Fixes: https://gitlab.freedesktop.org/dbus/dbus/issues/208
(cherry picked from commit 3ef9e789c1)
This commit is contained in:
parent
6ef67cff6b
commit
2b09942986
1 changed files with 1 additions and 2 deletions
|
|
@ -382,8 +382,7 @@ is_valid_section_name (const char *name)
|
|||
|
||||
while (*name)
|
||||
{
|
||||
if (!((*name >= 'A' && *name <= 'Z') || (*name >= 'a' || *name <= 'z') ||
|
||||
*name == '\n' || *name == '\t'))
|
||||
if (*name <= 0x1f || *name >= 0x7f || *name == '[' || *name == ']')
|
||||
return FALSE;
|
||||
|
||||
name++;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue