[oe-commits] [bitbake] branch master-next updated: data: Don't allow renameVar calls with equivalent keys

git at git.openembedded.org git at git.openembedded.org
Mon Feb 17 23:13:17 UTC 2020


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository bitbake.

The following commit(s) were added to refs/heads/master-next by this push:
     new 9c6eb97  data: Don't allow renameVar calls with equivalent keys
9c6eb97 is described below

commit 9c6eb9774d9314d4d7c1e3357c9bbfd9fa0b125f
Author: Kyle Russell <bkylerussell at gmail.com>
AuthorDate: Mon Feb 17 10:25:52 2020 -0500

    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 at gmail.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/data_smart.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py
index dd5c618..63a32bc 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)

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list