From 72b4b435587e54519cdd4dd48a455f223cac249b Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Mon, 29 Aug 2016 12:56:02 +0300 Subject: [PATCH] input/hog-lib: Fix not truncating name Bluetooth name can be bigger than uhid can support. --- profiles/input/hog-lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/profiles/input/hog-lib.c b/profiles/input/hog-lib.c index 0884ef792..e376c2bb0 100644 --- a/profiles/input/hog-lib.c +++ b/profiles/input/hog-lib.c @@ -1018,7 +1018,7 @@ static void report_map_read_cb(guint8 status, const guint8 *pdu, guint16 plen, return; } - strcpy((char *) ev.u.create.name, hog->name); + strncpy((char *) ev.u.create.name, hog->name, sizeof(ev.u.create.name)); ev.u.create.vendor = hog->vendor; ev.u.create.product = hog->product; ev.u.create.version = hog->version; -- 2.47.3