Blame SOURCES/0003-screencast-Validate-parameters-of-ScreencastArea.patch

b97e22
From 9712b5f8ce73aa40f74c33108cca12c35b50aee8 Mon Sep 17 00:00:00 2001
b97e22
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
b97e22
Date: Mon, 4 Nov 2013 14:09:19 +0100
b97e22
Subject: [PATCH 3/3] screencast: Validate parameters of ScreencastArea
b97e22
b97e22
... just as we do for screenshots.
b97e22
b97e22
https://bugzilla.gnome.org/show_bug.cgi?id=699752
b97e22
---
b97e22
 js/ui/screencast.js | 10 ++++++++++
b97e22
 1 file changed, 10 insertions(+)
b97e22
b97e22
diff --git a/js/ui/screencast.js b/js/ui/screencast.js
b97e22
index 7d8d767..168f589 100644
b97e22
--- a/js/ui/screencast.js
b97e22
+++ b/js/ui/screencast.js
b97e22
@@ -127,6 +127,16 @@ const ScreencastService = new Lang.Class({
b97e22
         if (!recorder.is_recording()) {
b97e22
             let [x, y, width, height, fileTemplate, options] = params;
b97e22
 
b97e22
+            if (x < 0 || y < 0 ||
b97e22
+                width <= 0 || height <= 0 ||
b97e22
+                x + width > global.screen_width ||
b97e22
+                y + height > global.screen_height) {
b97e22
+                invocation.return_error_literal(Gio.IOErrorEnum,
b97e22
+                                                Gio.IOErrorEnum.CANCELLED,
b97e22
+                                                "Invalid params");
b97e22
+                return;
b97e22
+            }
b97e22
+
b97e22
             recorder.set_file_template(fileTemplate);
b97e22
             recorder.set_area(x, y, width, height);
b97e22
             this._applyOptionalParameters(recorder, options);
b97e22
-- 
b97e22
1.8.4.2
b97e22