summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-05-08 01:23:11 +0000
committerJeremy Allison <jra@samba.org>1998-05-08 01:23:11 +0000
commit9273102ea54d010043e6fdfaf1c61116eb93562e (patch)
treeb8acb68c2c8a4049cfaabd8d678d8e6a1d6798e0 /source3/smbd
parent4cc7a1b0ef893941446c5f03b9372966a453cb6a (diff)
downloadsamba-9273102ea54d010043e6fdfaf1c61116eb93562e.tar.gz
samba-9273102ea54d010043e6fdfaf1c61116eb93562e.tar.bz2
samba-9273102ea54d010043e6fdfaf1c61116eb93562e.zip
smb.h: Supporting defines for NT trans calls.
trans2.c: Paranoia bugfixes added when studying nttrans.c. Jeremy. (This used to be commit 94e70edef91c71703a7ebcdaf2b5a2bdce940a69)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/trans2.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 75cf18785c..af70064ef4 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -1787,8 +1787,10 @@ int reply_trans2(char *inbuf,char *outbuf,int length,int bufsize)
if (num_params > total_params || num_data > total_data)
exit_server("invalid params in reply_trans2");
- memcpy( params, smb_base(inbuf) + SVAL(inbuf, smb_psoff), num_params);
- memcpy( data, smb_base(inbuf) + SVAL(inbuf, smb_dsoff), num_data);
+ if(params)
+ memcpy( params, smb_base(inbuf) + SVAL(inbuf, smb_psoff), num_params);
+ if(data)
+ memcpy( data, smb_base(inbuf) + SVAL(inbuf, smb_dsoff), num_data);
if(num_data_sofar < total_data || num_params_sofar < total_params)
{
@@ -1812,8 +1814,10 @@ int reply_trans2(char *inbuf,char *outbuf,int length,int bufsize)
else
DEBUG(0,("reply_trans2: %s in getting secondary trans2 response.\n",
(smb_read_error == READ_ERROR) ? "error" : "timeout" ));
- free(params);
- free(data);
+ if(params)
+ free(params);
+ if(data)
+ free(data);
return(ERROR(ERRSRV,ERRerror));
}