From e1d8239d47f47fd98fa52bf59d823fbc44644e15 Mon Sep 17 00:00:00 2001 From: Jaehyun Kim Date: Fri, 30 Sep 2022 18:01:12 +0900 Subject: [PATCH] Check dbus path before constructing AddNetwork message >0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 >1 0xb6bf0788 in __GI_abort () at abort.c:79 >2 0xb6e63a9c in _dbus_abort () at dbus-sysdeps.c:93 >3 0xb6e58278 in _dbus_warn_check_failed (format=0xb6e69e1c "arguments to %s() were incorrect, assertion \"%s\" failed in file %s line %d.\nThis is normally a bug in some application using the D-Bus library.\n") at dbus-internals.c:281 >4 0xb6e58980 in _dbus_warn_return_if_fail (function=, assertion=, file=, line=line@entry=1582) at dbus-internals.c:936 >5 0xb6e47c7c in dbus_message_new_method_call (destination=0x51a004 "fi.w1.wpa_supplicant1", path=path@entry=0x6bebf8 "", iface=iface@entry=0x519fa8 "fi.w1.wpa_supplicant1.Interface", method=method@entry=0x51a4c8 "AddNetwork") at dbus-message.c:1582 >6 0x004bdbda in supplicant_dbus_method_call (path=0x6bebf8 "", interface=0x519fa8 "fi.w1.wpa_supplicant1.Interface", method=0x51a4c8 "AddNetwork", setup=0x4baf7d , function=0x4b985d , user_data=user_data@entry=0x6d05f0, caller=0x6d9900) at gsupplicant/dbus.c:508 >7 0x004b64d8 in decryption_request_reply (call=0x6b25c0, user_data=0x6d05f0) at gsupplicant/supplicant.c:7653 ... Change-Id: Ib65368a6a43c81376ae65bd5338d796bc7ad755c Signed-off-by: Jaehyun Kim --- gsupplicant/supplicant.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c index 12aed30..7f65e02 100755 --- a/gsupplicant/supplicant.c +++ b/gsupplicant/supplicant.c @@ -7641,6 +7641,12 @@ static void decryption_request_reply(DBusPendingCall *call, goto done; } + if (!g_str_has_prefix(data->interface->path, "/")) { + SUPPLICANT_DBG("Invalid path %s", data->interface->path); + ret = -EINVAL; + goto done; + } + if (dbus_message_iter_init(reply, &args) == FALSE) { SUPPLICANT_DBG("dbus_message_iter_init() failed"); ret = -EINVAL; -- 2.7.4