libnm: use flexible array member in NMUtilsStrStrDictKey

Otherwise, gcc-14.0.1-0.2.fc40 warns:

  ../src/libnm-core-impl/nm-utils.c: In function _nm_utils_strstrdictkey_create:
  ../src/libnm-core-impl/nm-utils.c:5076:16: error: allocation of insufficient size '1' for type 'NMUtilsStrStrDictKey' {aka 'struct _NMUtilsStrStrDictKey'} with size '2' [-Werror=alloc-size]
   5076 |         return g_malloc0(1);
        |                ^~~~~~~~~~~~

(cherry picked from commit 63ab0d926d)
This commit is contained in:
Thomas Haller 2024-01-23 10:27:13 +01:00 committed by Beniamino Galvani
parent eaa3a4e396
commit 157c2ffeee

View file

@ -5008,7 +5008,7 @@ nm_utils_bond_mode_string_to_int(const char *mode)
struct _NMUtilsStrStrDictKey {
char type;
char data[1];
char data[];
};
guint