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.5.0~150 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=80f8083b19da35f4cf015d6e612f3517635b04a4;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;