dbus-message: Report OOM as OOM, not InvalidArgs
Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/420 Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
parent
ccab882bad
commit
3c0e63c10a
|
@ -5201,6 +5201,9 @@ dbus_message_demarshal (const char *str,
|
|||
return msg;
|
||||
|
||||
fail_corrupt:
|
||||
if (loader->corruption_reason == DBUS_VALIDITY_UNKNOWN_OOM_ERROR)
|
||||
goto fail_oom;
|
||||
|
||||
dbus_set_error (error, DBUS_ERROR_INVALID_ARGS, "Message is corrupted (%s)",
|
||||
_dbus_validity_to_error_message (loader->corruption_reason));
|
||||
_dbus_message_loader_unref (loader);
|
||||
|
|
|
@ -291,15 +291,6 @@ test_valid_message_blobs (void *message_name,
|
|||
goto out;
|
||||
}
|
||||
|
||||
/* TODO: Validity checking sometimes returns InvalidArgs for OOM */
|
||||
if (dbus_error_has_name (&e, DBUS_ERROR_INVALID_ARGS) &&
|
||||
!have_memory &&
|
||||
strstr (e.message, "Out of memory") != NULL)
|
||||
{
|
||||
g_test_message ("Out of memory (not a problem)");
|
||||
goto out;
|
||||
}
|
||||
|
||||
g_test_message ("Parsing %s reported unexpected error %s: %s",
|
||||
path, e.name, e.message);
|
||||
g_test_fail ();
|
||||
|
|
Loading…
Reference in New Issue