[rygel] core: Add extra checks for Mute and Volume



commit feed03ae4218dc7dffb4e4d113a643fd04faf6c3
Author: Jens Georg <mail jensge org>
Date:   Fri May 11 13:55:00 2012 +0200

    core: Add extra checks for Mute and Volume

 src/rygel/rygel-rendering-control.vala |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/src/rygel/rygel-rendering-control.vala b/src/rygel/rygel-rendering-control.vala
index b50240f..35ebce8 100644
--- a/src/rygel/rygel-rendering-control.vala
+++ b/src/rygel/rygel-rendering-control.vala
@@ -204,6 +204,14 @@ internal class Rygel.RenderingControl : Service {
             return;
         }
 
+        string mute_str;
+        action.get ("DesiredMute", typeof (string), out mute_str);
+        if (mute_str.has_prefix ("-")) {
+            action.return_error (501, _("ActionFailed"));
+
+            return;
+        }
+
         bool mute;
 
         action.get ("DesiredMute", typeof (bool), out mute);
@@ -238,6 +246,14 @@ internal class Rygel.RenderingControl : Service {
             return;
         }
 
+        string volume_str;
+        action.get ("DesiredVolume", typeof (string), out volume_str);
+        if ("." in volume_str || "," in volume_str) {
+            action.return_error (501, _("ActionFailed"));
+
+            return;
+        }
+
         uint volume;
 
         action.get ("DesiredVolume", typeof (uint), out volume);



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