aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb/data_smart.py
diff options
context:
space:
mode:
authorKyle Russell <bkylerussell@gmail.com>2020-02-17 10:25:52 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-02-19 11:25:32 +0000
commit01bf0912eef5700d61c6e3c9138cb4b6825ee782 (patch)
treed09c730543cbd13698c4acaf608b242d9ef6b75e /lib/bb/data_smart.py
parentba093a38539960e645e994a66ed7872a604c00a9 (diff)
downloadbitbake-01bf0912eef5700d61c6e3c9138cb4b6825ee782.tar.gz
data: Don't allow renameVar calls with equivalent keys
While usually a programming error, the behavior can cause a Parser instance to eventually gobble up a significant amount of memory, greatly affecting system performance. Try to avoid getting into that situation and alert the user about what they attempted to do. Signed-off-by: Kyle Russell <bkylerussell@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/data_smart.py')
-rw-r--r--lib/bb/data_smart.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py
index dd5c61856..63a32bc6a 100644
--- a/lib/bb/data_smart.py
+++ b/lib/bb/data_smart.py
@@ -607,6 +607,10 @@ class DataSmart(MutableMapping):
"""
Rename the variable key to newkey
"""
+ if key == newkey:
+ bb.warn("Calling renameVar with equivalent keys (%s) is invalid" % key)
+ return
+
if '_remote_data' in self.dict:
connector = self.dict["_remote_data"]["_content"]
res = connector.renameVar(key, newkey)