summaryrefslogtreecommitdiff
path: root/decoder.c
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2019-11-12 22:47:41 +0100
committerUwe Hermann <uwe@hermann-uwe.de>2019-12-09 15:42:34 +0100
commitf8c24e2e58ee76e6bdc50b87060e2efb7e8838ba (patch)
tree396623c2d38f02f721cab1b31e344b8adf8b7bb0 /decoder.c
parent5d6d8896ded87ce72b42e68c77120008b2d1b779 (diff)
downloadlibsigrokdecode-f8c24e2e58ee76e6bdc50b87060e2efb7e8838ba.tar.gz
libsigrokdecode-f8c24e2e58ee76e6bdc50b87060e2efb7e8838ba.zip
srd_decoder_doc_get(): Add an additional sanity check.
Diffstat (limited to 'decoder.c')
-rw-r--r--decoder.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/decoder.c b/decoder.c
index 5239818..cef4f29 100644
--- a/decoder.c
+++ b/decoder.c
@@ -869,7 +869,7 @@ err_out:
/**
* Return a protocol decoder's docstring.
*
- * @param dec The loaded protocol decoder.
+ * @param dec The loaded protocol decoder. Must not be NULL.
*
* @return A newly allocated buffer containing the protocol decoder's
* documentation. The caller is responsible for free'ing the buffer.
@@ -885,7 +885,7 @@ SRD_API char *srd_decoder_doc_get(const struct srd_decoder *dec)
if (!srd_check_init())
return NULL;
- if (!dec)
+ if (!dec || !dec->py_mod)
return NULL;
gstate = PyGILState_Ensure();