coverity.com fixes - initial round

This commit tries to fix a bunch of issues found
by coverity.com.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2025-11-10 17:56:27 +01:00
parent f0679e5de2
commit 47f4f9b73b
40 changed files with 283 additions and 133 deletions

View file

@ -612,7 +612,7 @@ static char *rval_sysfs_main(snd_use_case_mgr_t *uc_mgr, const char *top_path, c
if (s == NULL)
return NULL;
len = s - id - 1;
if ((size_t)(len - 1) > sizeof(link) - 1)
if ((size_t)len > sizeof(link) - 1)
return NULL;
strncpy(link, id + 1, len);
link[len] = '\0';