Fix segfault in jack_connect

When jack_connect is called without any argument, it causes a segfault
in

                snprintf( portA, sizeof(portA), "%s", argv[argc-1] );
                snprintf( portB, sizeof(portB), "%s", argv[argc-2] );

Reported in http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=662199
This commit is contained in:
Adrian Knoth 2012-03-08 21:54:22 +01:00
parent d7fceb12fb
commit 00280570af
1 changed files with 4 additions and 1 deletions

View File

@ -128,7 +128,10 @@ main (int argc, char *argv[])
return 1;
}
if (argc < 3) show_usage(my_name);
if (argc < 3) {
show_usage(my_name);
return 1;
}
/* try to become a client of the JACK server */