diff options
author | Jeremy Allison <jra@samba.org> | 1997-09-26 18:55:29 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 1997-09-26 18:55:29 +0000 |
commit | e7eb1f044d3101679dc7a118820ea5efe0cd837c (patch) | |
tree | 08728855970cb96ca587b1bf241304f579d85c22 /source/client | |
parent | 2c5587a6fe425b1cc57cf28e92e77ba84f08ce33 (diff) | |
download | samba-e7eb1f044d3101679dc7a118820ea5efe0cd837c.tar.gz samba-e7eb1f044d3101679dc7a118820ea5efe0cd837c.tar.xz samba-e7eb1f044d3101679dc7a118820ea5efe0cd837c.zip |
Adding Andrews buffer overflow fixes into the main branch.
Jeremy (jallison@whistle.com)
Diffstat (limited to 'source/client')
-rw-r--r-- | source/client/clientutil.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/source/client/clientutil.c b/source/client/clientutil.c index 07c340ccacd..d16e5a471fc 100644 --- a/source/client/clientutil.c +++ b/source/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")); |