]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
more useful debug messages and check if the size are non null.
authorJean-François Micouleau <jfm@samba.org>
Fri, 17 Aug 2001 17:07:40 +0000 (17:07 +0000)
committerJean-François Micouleau <jfm@samba.org>
Fri, 17 Aug 2001 17:07:40 +0000 (17:07 +0000)
that fix the notification backend channel for spoolss.

J.F.

source/libsmb/clitrans.c

index c4e19b9375f3c1969a124cf56fa3926e2c47a566..c97ddfc33188499f45c8ca77d92543994fb9dee3 100644 (file)
@@ -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);