diff options
author | fps <mista.tapas@gmx.net> | 2020-07-09 06:56:56 +0200 |
---|---|---|
committer | Filipe Coelho <falktx@falktx.com> | 2020-07-09 07:06:16 +0200 |
commit | 1bce1e41139c51bf2e1a5302022905262d4e333e (patch) | |
tree | e65565db67912f27393d84af47d7fbf3b1587fdd | |
parent | d95c7a6efbc2ba82f09a7b11a6e4debac3d6ad88 (diff) | |
download | jack2-1bce1e41139c51bf2e1a5302022905262d4e333e.tar.gz |
jack_connect: fix off-by-one error in allocating space for the server name string
-rw-r--r-- | example-clients/connect.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/example-clients/connect.c b/example-clients/connect.c index b302ce67..fc43b5e9 100644 --- a/example-clients/connect.c +++ b/example-clients/connect.c @@ -88,7 +88,7 @@ main (int argc, char *argv[]) while ((c = getopt_long (argc, argv, "s:hvu", long_options, &option_index)) >= 0) { switch (c) { case 's': - server_name = (char *) malloc (sizeof (char) * strlen(optarg)); + server_name = (char *) malloc (sizeof (char) * (strlen(optarg) + 1)); strcpy (server_name, optarg); options |= JackServerName; break; |