DBusString nonce;
_dbus_assert (noncefile != NULL);
- _dbus_string_init (&nonce);
+ if (!_dbus_string_init (&nonce))
+ return -1;
//PENDING(kdab): set better errors
if (_dbus_read_nonce (_dbus_noncefile_get_path(noncefile), &nonce, NULL) != TRUE)
return -1;
_DBUS_ASSERT_ERROR_IS_CLEAR (error);
- _dbus_string_init (&nonce);
+ if (!_dbus_string_init (&nonce))
+ {
+ dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
+ return FALSE;
+ }
if (!_dbus_generate_random_bytes (&nonce, 16))
{
return FALSE;
}
- ret = _dbus_string_save_to_file (&nonce, filename, error);
+ ret = _dbus_string_save_to_file (&nonce, filename, FALSE, error);
_dbus_string_free (&nonce);
{
dbus_bool_t read_result;
int send_result;
- size_t sendLen;
DBusString nonce;
_DBUS_ASSERT_ERROR_IS_CLEAR (error);
DBusError *error,
dbus_bool_t use_subdir)
{
- dbus_bool_t ret;
DBusString randomStr;
_DBUS_ASSERT_ERROR_IS_CLEAR (error);
}
if (!_dbus_string_init (&noncefile->path)
|| !_dbus_string_copy (&noncefile->dir, 0, &noncefile->path, 0)
- || !_dbus_string_append (&noncefile->dir, "/nonce"))
+ || !_dbus_string_append (&noncefile->path, "/nonce"))
{
dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
goto on_error;