From 06b2c82a436c0806d6d1dc0ef3828fdc82f19576 Mon Sep 17 00:00:00 2001 From: Kyle Russell Date: Mon, 17 Feb 2020 10:25:52 -0500 Subject: bitbake: 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. (Bitbake rev: 01bf0912eef5700d61c6e3c9138cb4b6825ee782) Signed-off-by: Kyle Russell Signed-off-by: Richard Purdie --- bitbake/lib/bb/data_smart.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'bitbake') diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py index dd5c618564..63a32bc6a7 100644 --- a/bitbake/lib/bb/data_smart.py +++ b/bitbake/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) -- cgit v1.2.3-54-g00ecf