summaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
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) {