diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-05-29 10:30:36 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-07-12 22:50:27 +0100 |
commit | 07d773369f571028c2cf82dd1f65d9731af6d00e (patch) | |
tree | a45e70588efb062e21691707c953b6f68dcb6b22 /lib/bb/data_smart.py | |
parent | 41cf8d0c92d2d8a33fdad0921e424a0024914be1 (diff) | |
download | bitbake-contrib-07d773369f571028c2cf82dd1f65d9731af6d00e.tar.gz |
data_smart: Improve override recursion handling
When expanding OVERRIDES, its possible someone might try and override a variable
that is used in OVERRIDES. This could lead to infinite recursion. Add in
guards against this.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/data_smart.py')
-rw-r--r-- | lib/bb/data_smart.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py index c800a9a10..c91b51f68 100644 --- a/lib/bb/data_smart.py +++ b/lib/bb/data_smart.py @@ -313,6 +313,7 @@ class DataSmart(MutableMapping): self.overridedata = {} self.overrides = None self.overridevars = set(["OVERRIDES", "FILE"]) + self.inoverride = False def enableTracking(self): self._tracking = True @@ -363,8 +364,13 @@ class DataSmart(MutableMapping): def need_overrides(self): if self.overrides is None: + if self.inoverride: + return + self.inoverride = True + # Can end up here recursively so setup dummy values self.overrides = [] self.overrides = (self.getVar("OVERRIDES", True) or "").split(":") or [] + self.inoverride = False self.expand_cache = {} def initVar(self, var): |