Skip to content

Commit 34668eb

Browse files
committed
acap/jack: fix CID 480385
an overflow
1 parent afe2c2d commit 34668eb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/audio/capture/jack.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,10 @@ static void * audio_cap_jack_init(struct module *parent, const char *cfg)
181181
goto error;
182182
}
183183
} else if (strstr(item, "name=") == item) {
184-
strcpy(client_name, item + strlen("name="));
184+
strncpy(client_name, item + strlen("name="),
185+
sizeof client_name - 1);
186+
// ensure termination if truncated
187+
client_name[sizeof client_name - 1] = '\0';
185188
} else { // this is the device name
186189
source_name = cfg + (item - dup);
187190
break;

0 commit comments

Comments
 (0)