]> sigrok.org Git - libsigrokdecode.git/commitdiff
srd_inst_decode(): Return SRD_ERR_ARG if unitsize is 0.
authorUwe Hermann <redacted>
Thu, 25 Aug 2016 20:34:55 +0000 (22:34 +0200)
committerUwe Hermann <redacted>
Mon, 26 Dec 2016 21:40:46 +0000 (22:40 +0100)
instance.c

index 86b826f25f9bb6656965c4522f2c99c29470114e..b1bfd81ce0bf2fef4281087ce5f967d3afc75061 100644 (file)
@@ -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;