acap/jack: fix CID 480385

an overflow
This commit is contained in:
Martin Pulec
2025-04-16 08:17:50 +02:00
parent afe2c2df3e
commit 34668eb6ee

View File

@@ -181,7 +181,10 @@ static void * audio_cap_jack_init(struct module *parent, const char *cfg)
goto error;
}
} else if (strstr(item, "name=") == item) {
strcpy(client_name, item + strlen("name="));
strncpy(client_name, item + strlen("name="),
sizeof client_name - 1);
// ensure termination if truncated
client_name[sizeof client_name - 1] = '\0';
} else { // this is the device name
source_name = cfg + (item - dup);
break;