summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorJean-François Micouleau <jfm@samba.org>2001-08-17 17:07:40 +0000
committerJean-François Micouleau <jfm@samba.org>2001-08-17 17:07:40 +0000
commitccb927b17ca3194118b9dfc9a5a533b62a448ec7 (patch)
treee85e14047fd6888a26f016463a79a3222e566e8a /source3/libsmb
parent8db28234c548cc4a381f93981df607ffe816c664 (diff)
downloadsamba-ccb927b17ca3194118b9dfc9a5a533b62a448ec7.tar.gz
samba-ccb927b17ca3194118b9dfc9a5a533b62a448ec7.tar.bz2
samba-ccb927b17ca3194118b9dfc9a5a533b62a448ec7.zip
more useful debug messages and check if the size are non null.
that fix the notification backend channel for spoolss. J.F. (This used to be commit 5e9a36bd9c1aa1a28f042ec9016a097215e4539e)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/clitrans.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/source3/libsmb/clitrans.c b/source3/libsmb/clitrans.c
index c4e19b9375..c97ddfc331 100644
--- a/source3/libsmb/clitrans.c
+++ b/source3/libsmb/clitrans.c
@@ -188,18 +188,25 @@ BOOL cli_receive_trans(struct cli_state *cli,int trans,
total_param = SVAL(cli->inbuf,smb_tprcnt);
/* allocate it */
- tdata = Realloc(*data,total_data);
- if (!tdata) {
- DEBUG(0,("cli_receive_trans: failed to enlarge buffer"));
- return False;
+ if (total_data!=0) {
+ tdata = Realloc(*data,total_data);
+ if (!tdata) {
+ DEBUG(0,("cli_receive_trans: failed to enlarge data buffer\n"));
+ return False;
+ }
+ else
+ *data = tdata;
}
- else *data = tdata;
- tdata = Realloc(*param,total_param);
- if (!tdata) {
- DEBUG(0,("cli_receive_trans: failed to enlarge buffer"));
- return False;
+
+ if (total_param!=0) {
+ tdata = Realloc(*param,total_param);
+ if (!tdata && total_param!=0) {
+ DEBUG(0,("cli_receive_trans: failed to enlarge param buffer\n"));
+ return False;
+ }
+ else
+ *param = tdata;
}
- else *param = tdata;
while (1) {
this_data = SVAL(cli->inbuf,smb_drcnt);