From: Uwe Hermann Date: Thu, 25 Aug 2016 20:34:55 +0000 (+0200) Subject: srd_inst_decode(): Return SRD_ERR_ARG if unitsize is 0. X-Git-Tag: libsigrokdecode-0.4.1~9 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=7b62f75e9beb3da64c0f009740fe0156e0694adf;p=libsigrokdecode.git srd_inst_decode(): Return SRD_ERR_ARG if unitsize is 0. --- 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;