[rygel] core: Don't crash on invalid input in CreateObject



commit 5e6f49b8fd3611e17bb476a49d8a284a587d4eda
Author: Jens Georg <mail jensge org>
Date:   Thu May 19 15:57:33 2011 +0200

    core: Don't crash on invalid input in CreateObject

 src/rygel/rygel-item-creator.vala |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/rygel/rygel-item-creator.vala b/src/rygel/rygel-item-creator.vala
index deaf737..7e5f34e 100644
--- a/src/rygel/rygel-item-creator.vala
+++ b/src/rygel/rygel-item-creator.vala
@@ -70,6 +70,12 @@ internal class Rygel.ItemCreator: GLib.Object, Rygel.StateMachine {
                 throw new ItemCreatorError.PARSE (message, this.elements);
             }
 
+            if (didl_item.id == null || didl_item.id != "") {
+                throw new ContentDirectoryError.BAD_METADATA
+                                        ("@id must be set to \"\" in " +
+                                         "CreateItem");
+            }
+
             if ((didl_item.title == null)) {
                 throw new ContentDirectoryError.BAD_METADATA
                                         ("dc:title must be set in " +



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]