[coap-message] fix buffer overflow in AppendUintOption() (#6163)

This commit is contained in:
Jonathan Hui
2021-02-12 11:25:58 -08:00
committed by GitHub
parent c8007768c7
commit 159efe77c0
+1 -1
View File
@@ -200,7 +200,7 @@ otError Message::AppendUintOption(uint16_t aNumber, uint32_t aValue)
Encoding::BigEndian::WriteUint32(aValue, buffer);
while (value[0] == 0 && length > 0)
while ((length > 0) && (value[0] == 0))
{
value++;
length--;