From 2447d279bd86a24524552a3c56410a39e7780d1d Mon Sep 17 00:00:00 2001 From: Gediminas Jakutis Date: Sat, 8 Jun 2019 12:51:42 +0300 Subject: device: random screen-related fixes. Signed-off-by: Gediminas Jakutis --- src/common/tlv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/common/tlv.c') diff --git a/src/common/tlv.c b/src/common/tlv.c index bf8a99c..84b20ca 100755 --- a/src/common/tlv.c +++ b/src/common/tlv.c @@ -88,7 +88,7 @@ int tlv_pack(struct tlv_packet *pack, struct tlv *tlv) /* packed tlv loses the pointer, so only take the header part into account */ raw_size = sizeof(tlv->head) + tlv->head.size; - if ((raw_size + pack->cursor + sizeof(tlv->head)) >= TLV_SZ_MAX) { + if ((raw_size + pack->cursor + tlv->head.type ? sizeof(tlv->head) : 0) >= TLV_SZ_MAX) { ret = ERROR; } else { if (pack->size < pack->cursor + raw_size) { -- cgit v1.2.3