summaryrefslogtreecommitdiff
path: root/instance.c
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2016-08-25 22:34:55 +0200
committerUwe Hermann <uwe@hermann-uwe.de>2016-08-25 22:38:04 +0200
commit80f8083b19da35f4cf015d6e612f3517635b04a4 (patch)
treef9e82c5be08906b9d45b7b4d100ee9e52ae3b558 /instance.c
parent04867deb37b0f8cdfad55ab7bdb8708fd13f53fc (diff)
downloadlibsigrokdecode-80f8083b19da35f4cf015d6e612f3517635b04a4.tar.gz
libsigrokdecode-80f8083b19da35f4cf015d6e612f3517635b04a4.zip
srd_inst_decode(): Return SRD_ERR_ARG if unitsize is 0.
Diffstat (limited to 'instance.c')
-rw-r--r--instance.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/instance.c b/instance.c
index 86b826f..b1bfd81 100644
--- a/instance.c
+++ b/instance.c
@@ -558,6 +558,10 @@ SRD_PRIV int srd_inst_decode(const struct srd_decoder_inst *di,
srd_dbg("empty buffer");
return SRD_ERR_ARG;
}
+ if (unitsize == 0) {
+ srd_dbg("unitsize 0");
+ return SRD_ERR_ARG;
+ }
((struct srd_decoder_inst *)di)->data_unitsize = unitsize;