summaryrefslogtreecommitdiff
path: root/source3/smbd/message.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/smbd/message.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/smbd/message.c')
-rw-r--r--source3/smbd/message.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/source3/smbd/message.c b/source3/smbd/message.c
index 93a2d9d850..64253932ab 100644
--- a/source3/smbd/message.c
+++ b/source3/smbd/message.c
@@ -54,7 +54,7 @@ static void msg_deliver(void)
/* put it in a temporary file */
sprintf(s,"%s/msg.XXXXXX",tmpdir());
- strcpy(name,(char *)mktemp(s));
+ fstrcpy(name,(char *)mktemp(s));
fd = open(name,O_WRONLY|O_CREAT|O_TRUNC|O_EXCL,0600);
if (fd == -1) {
@@ -74,7 +74,7 @@ static void msg_deliver(void)
/* run the command */
if (*lp_msg_command())
{
- strcpy(s,lp_msg_command());
+ pstrcpy(s,lp_msg_command());
string_sub(s,"%s",name);
string_sub(s,"%f",msgfrom);
string_sub(s,"%t",msgto);
@@ -108,8 +108,8 @@ int reply_sends(char *inbuf,char *outbuf)
dest = skip_string(orig,1)+1;
msg = skip_string(dest,1)+1;
- strcpy(msgfrom,orig);
- strcpy(msgto,dest);
+ fstrcpy(msgfrom,orig);
+ fstrcpy(msgto,dest);
len = SVAL(msg,0);
len = MIN(len,1600-msgpos);
@@ -143,10 +143,10 @@ int reply_sendstrt(char *inbuf,char *outbuf)
orig = smb_buf(inbuf)+1;
dest = skip_string(orig,1)+1;
- strcpy(msgfrom,orig);
- strcpy(msgto,dest);
+ fstrcpy(msgfrom,orig);
+ fstrcpy(msgto,dest);
- DEBUG(3,("%s SMBsendstrt (from %s to %s)\n",timestring(),orig,dest));
+ DEBUG(3,("%s SMBsendstrt (from %s to %s)\n",timestring(),msgfrom,msgto));
return(outsize);
}