diff options
author | Uwe Hermann <uwe@hermann-uwe.de> | 2016-08-25 22:34:55 +0200 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2016-08-25 22:38:04 +0200 |
commit | 80f8083b19da35f4cf015d6e612f3517635b04a4 (patch) | |
tree | f9e82c5be08906b9d45b7b4d100ee9e52ae3b558 /instance.c | |
parent | 04867deb37b0f8cdfad55ab7bdb8708fd13f53fc (diff) | |
download | libsigrokdecode-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.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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; |