From 2f4368de81764519281b75c29e802b59aeadb7c5 Mon Sep 17 00:00:00 2001 From: ihsinme Date: Tue, 1 Mar 2022 06:14:45 +0000 Subject: [PATCH] device: Fix writing out of bounds array %32s expect a buffer of at least 33 bytes since it is a string it needs to be NULL terminated. --- src/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/device.c b/src/device.c index 52e2399dd..3992f9a0c 100644 --- a/src/device.c +++ b/src/device.c @@ -3831,7 +3831,7 @@ static int load_chrc(char *handle, char *value, uint16_t properties, value_handle, handle_int; char uuid_str[MAX_LEN_UUID_STR]; struct gatt_db_attribute *att; - char val_str[32]; + char val_str[33]; uint8_t val[16]; size_t val_len; bt_uuid_t uuid; -- 2.47.3