From 5bf1f1ba1465fe40eb142dab6f52582db63999f3 Mon Sep 17 00:00:00 2001 From: Niklas Dusenlund Date: Mon, 2 Sep 2024 12:56:23 +0200 Subject: [PATCH] u2f: clang-tidy lint bugprone-not-null-terminated-result --- src/u2f.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/u2f.c b/src/u2f.c index 7615a2115..2f1ea1d04 100644 --- a/src/u2f.c +++ b/src/u2f.c @@ -696,7 +696,8 @@ static void _authenticate_continue(const USB_APDU* apdu, Packet* out_packet) size_t auth_packet_len = sizeof(U2F_AUTHENTICATE_RESP) - U2F_MAX_EC_SIG_SIZE + der_len; // Append success bytes - memcpy(buf + auth_packet_len, "\x90\x00", 2); + uint8_t success_bytes[] = {0x90, 0x00}; + memcpy(buf + auth_packet_len, success_bytes, sizeof(success_bytes)); _fill_message(buf, auth_packet_len + 2, out_packet); }