X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=utils%2Fmountd%2Fauth.c;h=950ea20721fe6273821ced59166996fd46d89548;hp=f7fe23dda5ba26b8453e56d99bb56476bd41ec75;hb=1cecd88106230fc9a8c3527bcdf4195150e9ad64;hpb=1992a667c49cdd83ff7d7414a07225fcf34f0ad2 diff --git a/utils/mountd/auth.c b/utils/mountd/auth.c index f7fe23d..950ea20 100644 --- a/utils/mountd/auth.c +++ b/utils/mountd/auth.c @@ -93,8 +93,13 @@ auth_authenticate_internal(char *what, struct sockaddr_in *caller, *error = unknown_host; if (!n) return NULL; - strcpy(my_client.m_hostname, *n?n:"DEFAULT"); - free(n); + free(my_client.m_hostname); + if (*n) { + my_client.m_hostname = n; + } else { + free(n); + my_client.m_hostname = xstrdup("DEFAULT"); + } my_client.m_naddr = 1; my_exp.m_client = &my_client;