summaryrefslogtreecommitdiff
path: root/source3/client/clientutil.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1997-09-26 18:55:29 +0000
committerJeremy Allison <jra@samba.org>1997-09-26 18:55:29 +0000
commitcef59090bb2fd3f8a9efd1a453cb90264b891d58 (patch)
tree694593e9501de3a8aa6966d7e0f9118c29b28447 /source3/client/clientutil.c
parent5a7b3294dbbe88f0d5da25a74b8112fc6c70af1f (diff)
downloadsamba-cef59090bb2fd3f8a9efd1a453cb90264b891d58.tar.gz
samba-cef59090bb2fd3f8a9efd1a453cb90264b891d58.tar.bz2
samba-cef59090bb2fd3f8a9efd1a453cb90264b891d58.zip
Adding Andrews buffer overflow fixes into the main branch.
Jeremy (jallison@whistle.com) (This used to be commit e7eb1f044d3101679dc7a118820ea5efe0cd837c)
Diffstat (limited to 'source3/client/clientutil.c')
-rw-r--r--source3/client/clientutil.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/source3/client/clientutil.c b/source3/client/clientutil.c
index 07c340ccac..d16e5a471f 100644
--- a/source3/client/clientutil.c
+++ b/source3/client/clientutil.c
@@ -171,7 +171,8 @@ BOOL cli_send_session_request(char *inbuf, char *outbuf)
int len = 4;
/* send a session request (RFC 8002) */
- strcpy(dest,desthost);
+ fstrcpy(dest,desthost);
+
p = strchr(dest,'.');
if (p) *p = 0;
@@ -302,11 +303,11 @@ BOOL cli_send_login(char *inbuf, char *outbuf, BOOL start_session, BOOL use_setu
outbuf = (char *)malloc(BUFFER_SIZE + SAFETY_MARGIN);
}
- strcpy(dev,"A:");
+ pstrcpy(dev,"A:");
if (connect_as_printer)
- strcpy(dev,"LPT1:");
+ pstrcpy(dev,"LPT1:");
if (connect_as_ipc)
- strcpy(dev,"IPC");
+ pstrcpy(dev,"IPC");
if (start_session && !cli_send_session_request(inbuf,outbuf))
@@ -438,7 +439,7 @@ BOOL cli_send_login(char *inbuf, char *outbuf, BOOL start_session, BOOL use_setu
{
fstring pword;
int passlen = strlen(pass)+1;
- strcpy(pword,pass);
+ fstrcpy(pword,pass);
if (doencrypt && *pass) {
DEBUG(5,("Using encrypted passwords\n"));
@@ -447,7 +448,7 @@ BOOL cli_send_login(char *inbuf, char *outbuf, BOOL start_session, BOOL use_setu
}
/* if in share level security then don't send a password now */
- if (!(sec_mode & 1)) {strcpy(pword, "");passlen=1;}
+ if (!(sec_mode & 1)) {fstrcpy(pword, "");passlen=1;}
/* send a session setup command */
bzero(outbuf,smb_size);
@@ -553,7 +554,7 @@ BOOL cli_send_login(char *inbuf, char *outbuf, BOOL start_session, BOOL use_setu
{
int passlen = strlen(pass)+1;
fstring pword;
- strcpy(pword,pass);
+ fstrcpy(pword,pass);
if (doencrypt && *pass) {
passlen=24;
@@ -562,7 +563,7 @@ BOOL cli_send_login(char *inbuf, char *outbuf, BOOL start_session, BOOL use_setu
/* if in user level security then don't send a password now */
if ((sec_mode & 1)) {
- strcpy(pword, ""); passlen=1;
+ fstrcpy(pword, ""); passlen=1;
}
set_message(outbuf,4,2 + strlen(service) + passlen + strlen(dev),True);
@@ -811,9 +812,9 @@ BOOL cli_open_sockets(int port)
}
else
{
- strcpy(service2,service);
+ pstrcpy(service2,service);
host = strtok(service2,"\\/");
- strcpy(desthost,host);
+ pstrcpy(desthost,host);
}
DEBUG(5,("Opening sockets\n"));