From 1da0e68501c6a44a0c6776f5b05152ede2d54a2c Mon Sep 17 00:00:00 2001 From: "Keith T. Garner" Date: Thu, 10 Jun 2021 14:48:09 -0500 Subject: [PATCH] fix stringop-truncation error fixes #1 --- blinkstick-userspace-led-daemon/src/LEDBinding.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blinkstick-userspace-led-daemon/src/LEDBinding.cpp b/blinkstick-userspace-led-daemon/src/LEDBinding.cpp index 66c84f7..57949c1 100644 --- a/blinkstick-userspace-led-daemon/src/LEDBinding.cpp +++ b/blinkstick-userspace-led-daemon/src/LEDBinding.cpp @@ -54,7 +54,7 @@ LEDBinding::~LEDBinding() void LEDBinding::registerUserSpaceLED() { struct uleds_user_dev dev; - strncpy(dev.name, mName.c_str(), LED_MAX_NAME_SIZE); + strncpy(dev.name, mName.c_str(), LED_MAX_NAME_SIZE - 1); dev.max_brightness = 100; mULedsFileDescriptor = open("/dev/uleds", O_RDWR);