summaryrefslogtreecommitdiff
path: root/libmysql
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2004-02-19 22:04:46 +0200
committerunknown <monty@mysql.com>2004-02-19 22:04:46 +0200
commit9bc5cdba41a0d2bc3c391469b14168f82e636a6b (patch)
tree08c075b3e2c0bbc36b991d19939b3e854361827d /libmysql
parent41a76c7c61b634ddb431dbb50e396d7dd5b5360c (diff)
parent68242939d818cf5d091d5dcf13e312994f423f9f (diff)
downloadmariadb-git-9bc5cdba41a0d2bc3c391469b14168f82e636a6b.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-4.0
into mysql.com:/home/my/mysql-4.0 libmysql/libmysql.c: Auto merged
Diffstat (limited to 'libmysql')
-rw-r--r--libmysql/libmysql.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index 2ed6abb8496..febae456fb2 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -316,7 +316,7 @@ HANDLE create_named_pipe(NET *net, uint connect_timeout, char **arg_host,
char **arg_unix_socket)
{
HANDLE hPipe=INVALID_HANDLE_VALUE;
- char szPipeName [ 1024 ];
+ char pipe_name[1024];
DWORD dwMode;
int i;
my_bool testing_named_pipes=0;
@@ -327,13 +327,15 @@ HANDLE create_named_pipe(NET *net, uint connect_timeout, char **arg_host,
if (!host || !strcmp(host,LOCAL_HOST))
host=LOCAL_HOST_NAMEDPIPE;
- strxnmov(szPipeName, sizeof(szPipeName), "\\\\", host, "\\pipe\\",
- unix_socket, NullS);
+
+ pipe_name[sizeof(pipe_name)-1]= 0; /* Safety if too long string */
+ strxnmov(pipe_name, sizeof(pipe_name)-1, "\\\\", host, "\\pipe\\",
+ unix_socket, NullS);
DBUG_PRINT("info",("Server name: '%s'. Named Pipe: %s", host, unix_socket));
for (i=0 ; i < 100 ; i++) /* Don't retry forever */
{
- if ((hPipe = CreateFile(szPipeName,
+ if ((hPipe = CreateFile(pipe_name,
GENERIC_READ | GENERIC_WRITE,
0,
NULL,
@@ -349,7 +351,7 @@ HANDLE create_named_pipe(NET *net, uint connect_timeout, char **arg_host,
return INVALID_HANDLE_VALUE;
}
/* wait for for an other instance */
- if (! WaitNamedPipe(szPipeName, connect_timeout*1000) )
+ if (! WaitNamedPipe(pipe_name, connect_timeout*1000) )
{
net->last_errno=CR_NAMEDPIPEWAIT_ERROR;
sprintf(net->last_error,ER(net->last_errno),host, unix_socket,