Message ID | 20240215122726.29248-1-jiri@resnulli.us (mailing list archive) |
---|---|
State | Accepted |
Commit | d0bcc15cbae806cad7d1d90003c82ecb5833b533 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net-next,v2] tools: ynl: don't access uninitialized attr_space variable | expand |
Hello: This patch was applied to netdev/net-next.git (main) by David S. Miller <davem@davemloft.net>: On Thu, 15 Feb 2024 13:27:26 +0100 you wrote: > From: Jiri Pirko <jiri@nvidia.com> > > If message contains unknown attribute and user passes > "--process-unknown" command line option, _decode() gets called with space > arg set to None. In that case, attr_space variable is not initialized > used which leads to following trace: > > [...] Here is the summary with links: - [net-next,v2] tools: ynl: don't access uninitialized attr_space variable https://git.kernel.org/netdev/net-next/c/d0bcc15cbae8 You are awesome, thank you!
diff --git a/tools/net/ynl/lib/ynl.py b/tools/net/ynl/lib/ynl.py index 03c7ca6aaae9..f45ee5f29bed 100644 --- a/tools/net/ynl/lib/ynl.py +++ b/tools/net/ynl/lib/ynl.py @@ -588,10 +588,10 @@ class YnlFamily(SpecFamily): return decoded def _decode(self, attrs, space, outer_attrs = None): + rsp = dict() if space: attr_space = self.attr_sets[space] - rsp = dict() - search_attrs = SpaceAttrs(attr_space, rsp, outer_attrs) + search_attrs = SpaceAttrs(attr_space, rsp, outer_attrs) for attr in attrs: try: