[rygel] core: Prevent crash on back-end misbehaviour
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] core: Prevent crash on back-end misbehaviour
- Date: Wed, 18 Jan 2012 17:19:53 +0000 (UTC)
commit c4d52f40dc783240f2b9129cc099ded918e126f7
Author: Jens Georg <mail jensge org>
Date: Mon Jan 9 19:11:12 2012 +0100
core: Prevent crash on back-end misbehaviour
If the backend declares the OCMFlag.UPLOAD in a non-writable container,
bail out instead of crashing.
src/rygel/rygel-item-creator.vala | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/rygel/rygel-item-creator.vala b/src/rygel/rygel-item-creator.vala
index 51b9040..4f87616 100644
--- a/src/rygel/rygel-item-creator.vala
+++ b/src/rygel/rygel-item-creator.vala
@@ -286,7 +286,8 @@ internal class Rygel.ItemCreator: GLib.Object, Rygel.StateMachine {
if (media_object == null || !(media_object is MediaContainer)) {
throw new ContentDirectoryError.NO_SUCH_OBJECT
(_("No such object"));
- } else if (!(OCMFlags.UPLOAD in media_object.ocm_flags)) {
+ } else if (!(OCMFlags.UPLOAD in media_object.ocm_flags) ||
+ !(media_object is WritableContainer)) {
throw new ContentDirectoryError.RESTRICTED_PARENT
(_("Object creation in %s not allowed"),
media_object.id);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]