do_check_nonce: Don't free uninitialized memory on OOM
authorSimon McVittie <smcv@collabora.com>
Mon, 6 Nov 2017 19:09:51 +0000 (19:09 +0000)
committerSimon McVittie <smcv@collabora.com>
Tue, 7 Nov 2017 11:43:31 +0000 (11:43 +0000)
commit208af9a447f3960db08083e1127d7389bdb711f2
treee83c209ddec1a7fa55a55bd761248f9628cfcab6
parentb5d1585b0f9c301ee11336a47396fcd6e539e8eb
do_check_nonce: Don't free uninitialized memory on OOM

If _dbus_string_init() fails, it doesn't guarantee that the string
is initialized to anything in particular. Worse, if
_dbus_string_init (&buffer) fails, p would never have been initialized
at all, due to the use of the short-circuiting || operator.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103597
(cherry picked from commit 0ea0e4b0fddd1109835b8b9f7a8319d59c8d9303)
dbus/dbus-nonce.c