提交 324b0af6 编写于 作者: S Samuel Ortiz 提交者: John W. Linville

NFC: Fix LLCP TLV building routine

The if logic could lead to zero length TLVs.
Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 279cf174
...@@ -102,7 +102,7 @@ u8 *nfc_llcp_build_tlv(u8 type, u8 *value, u8 value_length, u8 *tlv_length) ...@@ -102,7 +102,7 @@ u8 *nfc_llcp_build_tlv(u8 type, u8 *value, u8 value_length, u8 *tlv_length)
length = llcp_tlv_length[type]; length = llcp_tlv_length[type];
if (length == 0 && value_length == 0) if (length == 0 && value_length == 0)
return NULL; return NULL;
else else if (length == 0)
length = value_length; length = value_length;
*tlv_length = 2 + length; *tlv_length = 2 + length;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册