From: Simon McVittie Date: Thu, 18 Oct 2018 14:34:09 +0000 (+0100) Subject: desktop-file: Justify implementation of is_valid_section_name() X-Git-Tag: dbus-1.13.8~59^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=99580298f305e1e2426f0c016d797a1ff9ea0b79;p=thirdparty%2Fdbus.git desktop-file: Justify implementation of is_valid_section_name() Signed-off-by: Simon McVittie --- diff --git a/bus/desktop-file.c b/bus/desktop-file.c index 0b9c57cc8..1c4bb8844 100644 --- a/bus/desktop-file.c +++ b/bus/desktop-file.c @@ -378,7 +378,12 @@ parse_comment_or_blank (BusDesktopFileParser *parser) static dbus_bool_t is_valid_section_name (const char *name) { - /* 5. Group names may contain all ASCII characters except for control characters and '[' and ']'. */ + /* 5. Group names may contain all ASCII characters except for control characters and '[' and ']'. + * + * We don't use isprint() here because it's locale-dependent. ASCII + * characters <= 0x1f and 0x7f are control characters, and bytes with + * values >= 0x80 aren't ASCII. 0x20 is a space, which we must allow, + * not least because DBUS_SERVICE_SECTION contains one. */ while (*name) {