From: Rico Tzschichholz Date: Mon, 15 Mar 2021 15:02:29 +0000 (+0100) Subject: girparser: Handle empty "" element and report an error X-Git-Tag: 0.50.5~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=806373a21d46f8d5520bcc251b0104dde92abb24;p=thirdparty%2Fvala.git girparser: Handle empty "" element and report an error --- diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala index 02bc640ea..34a74e252 100644 --- a/vala/valagirparser.vala +++ b/vala/valagirparser.vala @@ -2748,7 +2748,16 @@ public class Vala.GirParser : CodeVisitor { type_name = ctype; } - DataType type = parse_type_from_gir_name (type_name, out no_array_length, out array_null_terminated, ctype); + DataType type; + if (type_name != null) { + type = parse_type_from_gir_name (type_name, out no_array_length, out array_null_terminated, ctype); + } else { + // empty + no_array_length = false; + array_null_terminated = false; + type = new InvalidType (); + Report.error (get_current_src (), "empty type element"); + } // type arguments / element types while (current_token == MarkupTokenType.START_ELEMENT) {