diff options
author | Tom Tromey <tom@tromey.com> | 2024-12-15 09:09:10 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2024-12-20 10:00:13 -0700 |
commit | cd676397e5a7920eb0fc916bfde787dde8dea149 (patch) | |
tree | 8dd21534b3cc711aed3ac652f60552d654404a5f /gdb/python/py-symbol.c | |
parent | 14848fc2b22e6e718abadcfbcc0491688df19a8e (diff) | |
download | binutils-cd676397e5a7920eb0fc916bfde787dde8dea149.zip binutils-cd676397e5a7920eb0fc916bfde787dde8dea149.tar.gz binutils-cd676397e5a7920eb0fc916bfde787dde8dea149.tar.bz2 |
Fix latent bug in gdbpy_lookup_static_symbols
gdbpy_lookup_static_symbols is missing an error check for the case
where symbol_to_symbol_object returns NULL.
Approved-By: Tom de Vries <tdevries@suse.de>
Diffstat (limited to 'gdb/python/py-symbol.c')
-rw-r--r-- | gdb/python/py-symbol.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gdb/python/py-symbol.c b/gdb/python/py-symbol.c index c1f8d6c..8648a50 100644 --- a/gdb/python/py-symbol.c +++ b/gdb/python/py-symbol.c @@ -632,10 +632,11 @@ gdbpy_lookup_static_symbols (PyObject *self, PyObject *args, PyObject *kw) if (symbol != nullptr) { - PyObject *sym_obj - = symbol_to_symbol_object (symbol); + PyObject *sym_obj = symbol_to_symbol_object (symbol); + if (sym_obj == nullptr) + return nullptr; if (PyList_Append (return_list.get (), sym_obj) == -1) - return NULL; + return nullptr; } } } |