NetworkManager/libnm-core
Thomas Haller 92b8161578 libnm: avoid allocating GBytes in _nm_utils_dhcp_duid_valid()
In a lot of cases, we don't require the GBytes out-argument. This
is the case when called from NMSettingIP6Config's verify().
Avoid allocating the GBytes instance and also don't heap allocate
the temporary buffer in that case.

Also, being called from NMSettingIP6Config's verify(), at which
point the string value contains untrusted data. Of course, we
do very badly in general protecting against the user creating
huge settings, which could trick NetworkManage to allocate
large amounts of memory (and being killed by glib's out of memory
handling). We should handle such cases better in general, but
just avoid it here.

Since we know that the buffer must hold at most 128+2 bytes,
we can stack allocate it. Later, in case we really need to
return the value, we can create a GBytes instance of the right
size.
2018-06-12 14:45:40 +02:00
..
tests build: use default NM_BUILD_* defines for tests 2018-05-31 15:59:38 +02:00
crypto.c libnm: refactor loop in crypto_md5_hash() 2016-11-09 12:07:33 +01:00
crypto.h build: refine the NETWORKMANAGER_COMPILATION define 2018-01-08 12:38:53 +01:00
crypto_gnutls.c crypto: don't try to decrypt PKCS#8 key if no password is supplied 2016-09-23 18:05:54 +02:00
crypto_nss.c all: use "unsigned" instead of "unsigned int" 2017-03-14 11:26:29 +01:00
meson.build build/meson: fix meson build for shared files 2018-05-31 15:59:38 +02:00
nm-connection-private.h build: refine the NETWORKMANAGER_COMPILATION define 2018-01-08 12:38:53 +01:00
nm-connection.c all: use the elvis operator wherever possible 2018-05-10 14:36:58 +02:00
nm-connection.h libnm-core: add NMSettingTCConfig with qdisc support 2017-12-11 10:52:22 +01:00
nm-core-enum-types.c.template build: use template files for enum types' sources generation 2017-12-18 11:25:06 +01:00
nm-core-enum-types.h.template build: use template files for enum types' sources generation 2017-12-18 11:25:06 +01:00
nm-core-internal.h libnm-core: add ipv6.dhcp-duid property 2018-06-08 18:23:31 +02:00
nm-core-types-internal.h build: refine the NETWORKMANAGER_COMPILATION define 2018-01-08 12:38:53 +01:00
nm-core-types.h libnm-core: add NMSettingTCConfig with qdisc support 2017-12-11 10:52:22 +01:00
nm-dbus-interface.h all: remove consecutive empty lines 2018-04-30 16:24:52 +02:00
nm-dbus-utils.c all: remove consecutive empty lines 2018-04-30 16:24:52 +02:00
nm-errors.c all: use NM_CACHED_QUARK_FCN() instead of G_DEFINE_QUARK() 2017-02-10 14:33:52 +01:00
nm-errors.h all: add new D-Bus API org.freedesktop.NetworkManager.Settings.Connection.Update2() 2017-12-05 11:50:52 +01:00
nm-json.c libnm-core: don't use RTLD_DEEPBIND when building with asan 2018-02-15 15:34:03 +01:00
nm-json.h libnm: only include "nm-jansson.h" from "nm-json.h" 2018-01-16 14:47:24 +01:00
nm-keyfile-internal.h all: remove consecutive empty lines 2018-04-30 16:24:52 +02:00
nm-keyfile-utils.c all: use the elvis operator wherever possible 2018-05-10 14:36:58 +02:00
nm-keyfile-utils.h build: refine the NETWORKMANAGER_COMPILATION define 2018-01-08 12:38:53 +01:00
nm-keyfile.c all: use the elvis operator wherever possible 2018-05-10 14:36:58 +02:00
nm-property-compare.c libnm-core: add backend for GVariant de/serialization of link_watchers. 2017-12-08 00:46:26 +01:00
nm-property-compare.h build: refine the NETWORKMANAGER_COMPILATION define 2018-01-08 12:38:53 +01:00
nm-setting-8021x.c all: remove consecutive empty lines 2018-04-30 16:24:52 +02:00
nm-setting-8021x.h all: remove consecutive empty lines 2018-04-30 16:24:52 +02:00
nm-setting-adsl.c all: use the elvis operator wherever possible 2018-05-10 14:36:58 +02:00
nm-setting-adsl.h libnm-core: sensible docstrings for NMSettings* 2017-03-17 10:15:11 +01:00
nm-setting-bluetooth.c core: infer the bluetooth type from the presence of the supplemental settings 2017-08-23 16:18:44 +02:00
nm-setting-bluetooth.h core/bluetooth: add NAP type 2017-05-31 20:15:52 +02:00
nm-setting-bond.c libnm: don't use deprecated tags for GOobject introspection 2018-03-26 12:46:22 +02:00
nm-setting-bond.h libnm-core: sensible docstrings for NMSettings* 2017-03-17 10:15:11 +01:00
nm-setting-bridge-port.c all: fix minor typos in settings docs 2017-07-03 21:23:27 +02:00
nm-setting-bridge-port.h libnm-core: sensible docstrings for NMSettings* 2017-03-17 10:15:11 +01:00
nm-setting-bridge.c libnm: move bridge min/max defines to header file 2017-11-23 18:43:48 +01:00
nm-setting-bridge.h bridge: introduce a bridge.group-forward-mask connection property 2017-07-27 09:35:11 +02:00
nm-setting-cdma.c libnm: use enum for setting priorities 2017-06-07 09:07:17 +02:00
nm-setting-cdma.h libnm-core: sensible docstrings for NMSettings* 2017-03-17 10:15:11 +01:00
nm-setting-connection.c libnm-core: add ipv6.dhcp-duid property 2018-06-08 18:23:31 +02:00
nm-setting-connection.h libnm: rename MDns flag UNKNOWN to DEFAULT 2018-01-09 14:24:53 +01:00
nm-setting-dcb.c gobject-introspection: made several fixes to the annotations 2018-03-26 12:45:49 +02:00
nm-setting-dcb.h all: remove consecutive empty lines 2018-04-30 16:24:52 +02:00
nm-setting-dummy.c libnm: use enum for setting priorities 2017-06-07 09:07:17 +02:00
nm-setting-dummy.h libnm-core: sensible docstrings for NMSettings* 2017-03-17 10:15:11 +01:00
nm-setting-generic.c libnm: use enum for setting priorities 2017-06-07 09:07:17 +02:00
nm-setting-generic.h libnm-core: sensible docstrings for NMSettings* 2017-03-17 10:15:11 +01:00
nm-setting-gsm.c all: fix minor typos in settings docs 2017-07-03 21:23:27 +02:00
nm-setting-gsm.h libnm-core: sensible docstrings for NMSettings* 2017-03-17 10:15:11 +01:00
nm-setting-infiniband.c libnm: use enum for setting priorities 2017-06-07 09:07:17 +02:00
nm-setting-infiniband.h libnm-core: sensible docstrings for NMSettings* 2017-03-17 10:15:11 +01:00
nm-setting-ip-config.c libnm-core: document dns priority 2018-05-14 15:22:50 +02:00
nm-setting-ip-config.h all: remove consecutive empty lines 2018-04-30 16:24:52 +02:00
nm-setting-ip-tunnel.c ip-tunnel: add support for tunnel flags 2018-01-05 18:25:08 +01:00
nm-setting-ip-tunnel.h ip-tunnel: add support for tunnel flags 2018-01-05 18:25:08 +01:00
nm-setting-ip4-config.c device: hash a per-host key for ipv4.dhcp-client-id=stable 2018-05-28 14:58:24 +02:00
nm-setting-ip4-config.h libnm-core: sensible docstrings for NMSettings* 2017-03-17 10:15:11 +01:00
nm-setting-ip6-config.c ifcfg: introduce DHCPV6_DUID to map ipv6.dhcp-duid property 2018-06-09 22:20:39 +02:00
nm-setting-ip6-config.h libnm-core: add ipv6.dhcp-duid property 2018-06-08 18:23:31 +02:00
nm-setting-macsec.c libnm: use enum for setting priorities 2017-06-07 09:07:17 +02:00
nm-setting-macsec.h libnm-core: sensible docstrings for NMSettings* 2017-03-17 10:15:11 +01:00
nm-setting-macvlan.c all: get rid of a handful of unused-but-set variables 2017-12-18 13:29:32 +01:00
nm-setting-macvlan.h libnm-core: sensible docstrings for NMSettings* 2017-03-17 10:15:11 +01:00
nm-setting-olpc-mesh.c libnm: use enum for setting priorities 2017-06-07 09:07:17 +02:00
nm-setting-olpc-mesh.h libnm-core: sensible docstrings for NMSettings* 2017-03-17 10:15:11 +01:00
nm-setting-ovs-bridge.c libnm-core: add ovs-bridge setting 2017-10-30 17:40:08 +01:00
nm-setting-ovs-bridge.h libnm-core: add ovs-bridge setting 2017-10-30 17:40:08 +01:00
nm-setting-ovs-interface.c all: remove consecutive empty lines 2018-04-30 16:24:52 +02:00
nm-setting-ovs-interface.h libnm-core: add ovs-interface setting 2017-10-30 17:40:08 +01:00
nm-setting-ovs-patch.c all: get rid of a handful of unused-but-set variables 2017-12-18 13:29:32 +01:00
nm-setting-ovs-patch.h libnm-core: add ovs-patch setting 2017-10-30 17:40:08 +01:00
nm-setting-ovs-port.c all: remove consecutive empty lines 2018-04-30 16:24:52 +02:00
nm-setting-ovs-port.h libnm-core: add ovs-port setting 2017-10-30 17:40:08 +01:00
nm-setting-ppp.c libnm: use enum for setting priorities 2017-06-07 09:07:17 +02:00
nm-setting-ppp.h libnm-core: sensible docstrings for NMSettings* 2017-03-17 10:15:11 +01:00
nm-setting-pppoe.c libnm-core: fix memory leak in NMSettingPppoe 2017-08-30 22:03:59 +02:00
nm-setting-pppoe.h libnm,clients: add 'parent' property to PPPoE setting 2017-08-05 08:03:15 +02:00
nm-setting-private.h all: remove consecutive empty lines 2018-04-30 16:24:52 +02:00
nm-setting-proxy.c libnm: use enum for setting priorities 2017-06-07 09:07:17 +02:00
nm-setting-proxy.h libnm-core: sensible docstrings for NMSettings* 2017-03-17 10:15:11 +01:00
nm-setting-serial.c all: remove consecutive empty lines 2018-04-30 16:24:52 +02:00
nm-setting-serial.h libnm-core: sensible docstrings for NMSettings* 2017-03-17 10:15:11 +01:00
nm-setting-tc-config.c all: remove consecutive empty lines 2018-04-30 16:24:52 +02:00
nm-setting-tc-config.h all: remove consecutive empty lines 2018-04-30 16:24:52 +02:00
nm-setting-team-port.c all: remove consecutive empty lines 2018-04-30 16:24:52 +02:00
nm-setting-team-port.h libnm-core: team-port: expose the new link-watchers property 2017-12-08 00:46:26 +01:00
nm-setting-team.c all: remove consecutive empty lines 2018-04-30 16:24:52 +02:00
nm-setting-team.h all: remove consecutive empty lines 2018-04-30 16:24:52 +02:00
nm-setting-tun.c core/platform: add support for TUN/TAP netlink support and various cleanup 2018-03-20 11:59:52 +01:00
nm-setting-tun.h libnm-core: sensible docstrings for NMSettings* 2017-03-17 10:15:11 +01:00
nm-setting-user.c all: use nm_utils_hash_keys_to_array() 2018-03-27 09:58:00 +02:00
nm-setting-user.h all: remove consecutive empty lines 2018-04-30 16:24:52 +02:00
nm-setting-vlan.c libnm: use enum for setting priorities 2017-06-07 09:07:17 +02:00
nm-setting-vlan.h all: replace "it's" with "its" where needed 2018-04-18 14:14:07 +02:00
nm-setting-vpn.c libnm: don't use deprecated tags for GOobject introspection 2018-03-26 12:46:22 +02:00
nm-setting-vpn.h all: remove consecutive empty lines 2018-04-30 16:24:52 +02:00
nm-setting-vxlan.c libnm: use enum for setting priorities 2017-06-07 09:07:17 +02:00
nm-setting-vxlan.h libnm-core: sensible docstrings for NMSettings* 2017-03-17 10:15:11 +01:00
nm-setting-wimax.c libnm: use enum for setting priorities 2017-06-07 09:07:17 +02:00
nm-setting-wimax.h libnm-core: sensible docstrings for NMSettings* 2017-03-17 10:15:11 +01:00
nm-setting-wired.c libnm: don't use deprecated tags for GOobject introspection 2018-03-26 12:46:22 +02:00
nm-setting-wired.h libnm-core: sensible docstrings for NMSettings* 2017-03-17 10:15:11 +01:00
nm-setting-wireless-security.c wifi: add support for FILS 2018-01-16 15:01:59 +01:00
nm-setting-wireless-security.h wifi: add support for FILS 2018-01-16 15:01:59 +01:00
nm-setting-wireless.c libnm/doc: explicitly point out privacy issue of setting wifi.hidden 2018-04-26 16:52:40 +02:00
nm-setting-wireless.h libnm-core: sensible docstrings for NMSettings* 2017-03-17 10:15:11 +01:00
nm-setting.c all: remove consecutive empty lines 2018-04-30 16:24:52 +02:00
nm-setting.h all: remove consecutive empty lines 2018-04-30 16:24:52 +02:00
nm-simple-connection.c libnm: optimize nm_simple_connection_new_clone() to not needlessly set the path 2018-04-13 09:09:46 +02:00
nm-simple-connection.h include: use double-quotes to include our own headers 2017-03-09 14:12:35 +01:00
nm-utils-private.h build: refine the NETWORKMANAGER_COMPILATION define 2018-01-08 12:38:53 +01:00
nm-utils.c libnm: avoid allocating GBytes in _nm_utils_dhcp_duid_valid() 2018-06-12 14:45:40 +02:00
nm-utils.h libnm-core: add functionality for dealing with tc-style traffic filter specifiers 2017-12-11 11:02:04 +01:00
nm-version.h version: rename macro NM_VERSION_CUR_STABLE to NM_API_VERSION 2018-01-23 10:54:11 +01:00
nm-vpn-dbus-interface.h all: remove consecutive empty lines 2018-04-30 16:24:52 +02:00
nm-vpn-editor-plugin.c build: qualify plugin dir name with a version string 2018-05-14 16:05:12 +02:00
nm-vpn-editor-plugin.h all: remove consecutive empty lines 2018-04-30 16:24:52 +02:00
nm-vpn-plugin-info.c all: remove consecutive empty lines 2018-04-30 16:24:52 +02:00
nm-vpn-plugin-info.h gobject-introspection: made several fixes to the annotations 2018-03-26 12:45:49 +02:00