summaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
authorGravatar Gediminas Jakutis <gediminas@varciai.lt> 2019-06-08 12:51:42 +0300
committerGravatar Gediminas Jakutis <gediminas@varciai.lt> 2019-06-08 12:51:42 +0300
commit2447d279bd86a24524552a3c56410a39e7780d1d (patch)
treedb008a20003e3ce6b4f930788b5d96af33874fd7 /src/common
parent30513e7a89cc2f9283458100dea298770c7d18de (diff)
downloadusurpation-2447d279bd86a24524552a3c56410a39e7780d1d.tar.gz
usurpation-2447d279bd86a24524552a3c56410a39e7780d1d.tar.bz2
usurpation-2447d279bd86a24524552a3c56410a39e7780d1d.zip
device: random screen-related fixes.
Signed-off-by: Gediminas Jakutis <gediminas@varciai.lt>
Diffstat (limited to 'src/common')
-rwxr-xr-xsrc/common/tlv.c2
1 files changed, 1 insertions, 1 deletions
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) {