[pkg-fso-commits] [SCM] FSO frameworkd Debian packaging branch, debian, updated. upstream/0.9.5.5-717-g0f98819

Sebastian Krzyszkowiak seba.dos1 at gmail.com
Sat Aug 6 08:18:06 UTC 2011


The following commit has been merged in the debian branch:
commit 5b7244665aeafd6e6a18b2475c0f0f940c7fe6fb
Author: Sebastian Krzyszkowiak <seba.dos1 at gmail.com>
Date:   Wed Aug 26 01:28:29 2009 +0200

    opimd: Calls, Notes: check entry id when deleting to prevent tracebacks

diff --git a/framework/subsystems/opimd/pimd_calls.py b/framework/subsystems/opimd/pimd_calls.py
index 1998895..78ed585 100644
--- a/framework/subsystems/opimd/pimd_calls.py
+++ b/framework/subsystems/opimd/pimd_calls.py
@@ -350,6 +350,8 @@ class CallDomain(Domain, GenericDomain):
     def Delete(self, rel_path):
         num_id = int(rel_path[1:])
 
+        self.check_entry_id(num_id)
+
         call = self._entries[num_id].get_fields(self._entries[num_id]._field_idx)
         if call['New'] and not call['Answered'] and call['Direction'] == 'in':
             self._new_missed_calls -= 1
@@ -368,9 +370,7 @@ class CallDomain(Domain, GenericDomain):
     def Update(self, data, rel_path):
         num_id = int(rel_path[1:])
 
-        # Make sure the requested call exists
-        if num_id >= len(self._entries) or self._entries[num_id]==None:
-            raise InvalidEntryID()
+        self.check_entry_id(num_id)
 
         callif = self._entries[num_id]
         call = callif.get_fields(callif._field_idx)
diff --git a/framework/subsystems/opimd/pimd_notes.py b/framework/subsystems/opimd/pimd_notes.py
index f0f95f9..b582606 100644
--- a/framework/subsystems/opimd/pimd_notes.py
+++ b/framework/subsystems/opimd/pimd_notes.py
@@ -323,6 +323,8 @@ class NoteDomain(Domain, GenericDomain):
     def Delete(self, rel_path):
         num_id = int(rel_path[1:])
 
+        self.check_entry_id(num_id)
+
         note = self._entries[num_id].get_fields(self._entries[num_id]._field_idx)
 
         if note.get('Tag'):
@@ -348,9 +350,7 @@ class NoteDomain(Domain, GenericDomain):
     def Update(self, data, rel_path):
         num_id = int(rel_path[1:])
 
-        # Make sure the requested note exists
-        if num_id >= len(self._entries) or self._entries[num_id]==None:
-            raise InvalidEntryID()
+        self.check_entry_id(num_id)
 
         noteif = self._entries[num_id]
         note = noteif.get_fields(noteif._field_idx)

-- 
FSO frameworkd Debian packaging



More information about the pkg-fso-commits mailing list