summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2019-06-29 17:00:02 +0100
committerSimon McVittie <smcv@collabora.com>2019-07-02 20:45:31 +0100
commit0cc191f8e861ba5b253b3c404f94fb5e8b75684f (patch)
tree2692bc5922a417dd74e94085499f4e7ac71019e3
parent0b8878133f806351b213b80097b2bd6de5677f2c (diff)
downloaddbus-0cc191f8e861ba5b253b3c404f94fb5e8b75684f.tar.gz
auth: Clear GUID from server if out of memory
If we retry processing the message in response to OOM, but we don't clear this buffer first, then the assertion at the beginning will fail. Signed-off-by: Simon McVittie <smcv@collabora.com>
-rw-r--r--dbus/dbus-auth.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/dbus/dbus-auth.c b/dbus/dbus-auth.c
index 9e8b2bc0..62b5b13c 100644
--- a/dbus/dbus-auth.c
+++ b/dbus/dbus-auth.c
@@ -1664,10 +1664,25 @@ process_ok(DBusAuth *auth,
_dbus_string_get_const_data (& DBUS_AUTH_CLIENT (auth)->guid_from_server));
if (auth->unix_fd_possible)
- return send_negotiate_unix_fd(auth);
+ {
+ if (!send_negotiate_unix_fd (auth))
+ {
+ _dbus_string_set_length (& DBUS_AUTH_CLIENT (auth)->guid_from_server, 0);
+ return FALSE;
+ }
+
+ return TRUE;
+ }
_dbus_verbose("Not negotiating unix fd passing, since not possible\n");
- return send_begin (auth);
+
+ if (!send_begin (auth))
+ {
+ _dbus_string_set_length (& DBUS_AUTH_CLIENT (auth)->guid_from_server, 0);
+ return FALSE;
+ }
+
+ return TRUE;
}
static dbus_bool_t