summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2011-04-04 09:37:07 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-05-06 15:50:29 +0100
commit824acff967ff74c0a678bf8accc4a514653f5783 (patch)
treec6839bf90a5cb7586c5b820a95addfa95c296bc9 /bitbake
parentd43e7a91f29443b189b76d3b4fb55661f9fb8748 (diff)
downloadpoky-824acff967ff74c0a678bf8accc4a514653f5783.tar.gz
poky-824acff967ff74c0a678bf8accc4a514653f5783.tar.bz2
poky-824acff967ff74c0a678bf8accc4a514653f5783.zip
persist_data: don't allow non-string keys/values
(Bitbake rev: 28958cd55e592853c68f5f2ba79381d1b8dcfb8f) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/persist_data.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/bitbake/lib/bb/persist_data.py b/bitbake/lib/bb/persist_data.py
index bf8fd77bf1..c9e80ba967 100644
--- a/bitbake/lib/bb/persist_data.py
+++ b/bitbake/lib/bb/persist_data.py
@@ -77,6 +77,11 @@ class SQLTable(collections.MutableMapping):
self._execute("DELETE from %s where key=?;" % self.table, [key])
def __setitem__(self, key, value):
+ if not isinstance(key, basestring):
+ raise TypeError('Only string keys are supported')
+ elif not isinstance(value, basestring):
+ raise TypeError('Only string values are supported')
+
data = self._execute("SELECT * from %s where key=?;" %
self.table, [key])
exists = len(list(data))