summaryrefslogtreecommitdiff
path: root/source3/smbd/reply.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2000-04-22 08:28:22 +0000
committerAndrew Tridgell <tridge@samba.org>2000-04-22 08:28:22 +0000
commitf7608e853596bcb6e8d3d4dd6bb4407fa090fbc1 (patch)
treeef08f29251f5db48e50d83a744e1636080012064 /source3/smbd/reply.c
parentd384e1801d7cd841f67f3c9216900d2e59e9d1d5 (diff)
downloadsamba-f7608e853596bcb6e8d3d4dd6bb4407fa090fbc1.tar.gz
samba-f7608e853596bcb6e8d3d4dd6bb4407fa090fbc1.tar.bz2
samba-f7608e853596bcb6e8d3d4dd6bb4407fa090fbc1.zip
fixed overlapping strcpy() found by insure
(This used to be commit 1106fa7f24d229c3877263b7a7dde359556435e6)
Diffstat (limited to 'source3/smbd/reply.c')
-rw-r--r--source3/smbd/reply.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 3acfd988d6..baff8f2ac8 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -260,10 +260,9 @@ int reply_tcon(connection_struct *conn,
/****************************************************************************
Reply to a tcon and X.
****************************************************************************/
-
int reply_tcon_and_X(connection_struct *conn, char *inbuf,char *outbuf,int length,int bufsize)
{
- pstring service;
+ fstring service;
pstring user;
pstring password;
pstring devicename;
@@ -295,11 +294,9 @@ int reply_tcon_and_X(connection_struct *conn, char *inbuf,char *outbuf,int lengt
passlen = strlen(password);
}
- fstrcpy(service,path+2);
- p = strchr(service,'\\');
+ p = strchr(path+2,'\\');
if (!p)
return(ERROR(ERRSRV,ERRinvnetname));
- *p = 0;
fstrcpy(service,p+1);
p = strchr(service,'%');
if (p) {
@@ -309,11 +306,11 @@ int reply_tcon_and_X(connection_struct *conn, char *inbuf,char *outbuf,int lengt
StrnCpy(devicename,path + strlen(path) + 1,6);
DEBUG(4,("Got device type %s\n",devicename));
- /*
- * Ensure the user and password names are in UNIX codepage format.
- */
+ /*
+ * Ensure the user and password names are in UNIX codepage format.
+ */
- dos_to_unix(user,True);
+ dos_to_unix(user,True);
if (!doencrypt)
dos_to_unix(password,True);