From: Jihoon Kim Date: Mon, 17 Jul 2023 04:56:38 +0000 (+0900) Subject: Fix issue detected by static analysis tool X-Git-Tag: accepted/tizen/unified/20240105.013022~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a032859dacfc148339a63f47e501e1bceccdb27d;p=platform%2Fupstream%2Flibinput.git Fix issue detected by static analysis tool Change-Id: I4dbabe8feab7a260260998f3f98fb9f532dc2fbd Signed-off-by: Jihoon Kim --- diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c index 5b040ce5..9ec09fac 100644 --- a/src/evdev-mt-touchpad.c +++ b/src/evdev-mt-touchpad.c @@ -1923,7 +1923,7 @@ tp_debug_touch_state(struct tp_dispatch *tp, tp_for_each_touch(tp, t) { if (i >= tp->nfingers_down) break; - sprintf(&buf[strlen(buf)], + snprintf(&buf[strlen(buf)], sizeof(buf), "slot %zd: %04d/%04d p%03d %s |", i++, t->point.x, diff --git a/src/util-strings.c b/src/util-strings.c index 1f9b8a74..e076b91a 100644 --- a/src/util-strings.c +++ b/src/util-strings.c @@ -190,7 +190,7 @@ strv_join(char **strv, const char *joiner) str = zalloc(slen + 1); /* trailing \0 */ for (s = strv; *s; s++) { - strcat(str, *s); + strncat(str, slen, *s); --count; if (count > 0) strcat(str, joiner);