[Pkg-mozext-commits] [perspectives-extension] 20/44: Pers_client_policy - Add sanity check so max_timespan cannot be larger than check length
David Prévot
taffit at moszumanska.debian.org
Sat Jun 6 02:55:28 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository perspectives-extension.
commit 032b9091a5f985cc110c5424b24c554a6d90211b
Author: Dave Schaefer <dave.schaefer at gmail.com>
Date: Mon Nov 3 22:06:26 2014 -0700
Pers_client_policy - Add sanity check so max_timespan cannot be larger than check length
---
plugin/chrome/content/client_policy.js | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/plugin/chrome/content/client_policy.js b/plugin/chrome/content/client_policy.js
index aee200a..97c37eb 100644
--- a/plugin/chrome/content/client_policy.js
+++ b/plugin/chrome/content/client_policy.js
@@ -261,6 +261,14 @@ key_weakly_seen_by_quorum : function(test_key, results, quorum_size, check_lengt
// 'max_timespan' in the last 'check_length' days. Only return 'true' if
// there is more than one key that has been seen though.
inconsistency_check : function(results, max_timespan, check_length) {
+
+ if (max_timespan > check_length) {
+ Pers_debug.d_print("error",
+ "Inconsistency check max timespan '" + max_timespan +
+ "' cannot be greater than check length '" + check_length + "'!");
+ return false;
+ }
+
var unique_keys = {};
for(var i = 0; i < results.length; i++) {
for(var j = 0; j < results[i].obs.length; j++) {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/perspectives-extension.git
More information about the Pkg-mozext-commits
mailing list