summaryrefslogtreecommitdiff
path: root/src/cli-debug.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2016-04-18 16:24:34 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2016-04-18 16:25:34 +0200
commit981d9fd34f9d5ce08e748ad33429489bb13ed90f (patch)
tree529a108bf789df8932f24e10e07ff73cc7bd22cc /src/cli-debug.c
parentbd819ee7ec69670028c3e118058f77ad104bd809 (diff)
downloadgnutls-981d9fd34f9d5ce08e748ad33429489bb13ed90f.tar.gz
tools: avoid relying on static buffers for service name
Diffstat (limited to 'src/cli-debug.c')
-rw-r--r--src/cli-debug.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cli-debug.c b/src/cli-debug.c
index 31e03c31d0..0c2e31226f 100644
--- a/src/cli-debug.c
+++ b/src/cli-debug.c
@@ -192,7 +192,7 @@ int main(int argc, char **argv)
gnutls_session_t state;
char portname[6];
socket_st hd;
- const char *app_proto = NULL;
+ char app_proto[32] = "";
cmd_parser(argc, argv);
@@ -236,11 +236,11 @@ int main(int argc, char **argv)
#endif
if (HAVE_OPT(APP_PROTO)) {
- app_proto = OPT_ARG(APP_PROTO);
+ snprintf(app_proto, sizeof(app_proto), "%s", OPT_ARG(APP_PROTO));
}
if (app_proto == NULL) {
- app_proto = port_to_service(portname, "tcp");
+ snprintf(app_proto, sizeof(app_proto), "%s", port_to_service(portname, "tcp"));
}
sockets_init();