diff options
author | Jeremy Allison <jra@samba.org> | 1998-09-28 23:55:09 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 1998-09-28 23:55:09 +0000 |
commit | 008fd973097303ac984cd7c004e3dea67d54813d (patch) | |
tree | 9b3d2d82075cf04cbff491c9754cdedf103aeb0d /source3/client | |
parent | d455d42234ebe28f00ae360627fcb2a2f88787e0 (diff) | |
download | samba-008fd973097303ac984cd7c004e3dea67d54813d.tar.gz samba-008fd973097303ac984cd7c004e3dea67d54813d.tar.bz2 samba-008fd973097303ac984cd7c004e3dea67d54813d.zip |
Fixed problems found in lint pass over the old code by <cpeterso@microsoft.com>.
These were the problems that still existed in the 2.0 branch.
Jeremy.
(This used to be commit 3fd28812f75f2311a114ff905143634e3bbb1fac)
Diffstat (limited to 'source3/client')
-rw-r--r-- | source3/client/clientutil.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/source3/client/clientutil.c b/source3/client/clientutil.c index 2afbde85b5..7f5943cb01 100644 --- a/source3/client/clientutil.c +++ b/source3/client/clientutil.c @@ -105,6 +105,11 @@ BOOL cli_call_api(char *pipe_name, int pipe_name_len, if (!inbuf) inbuf = (char *)malloc(BUFFER_SIZE + SAFETY_MARGIN); if (!outbuf) outbuf = (char *)malloc(BUFFER_SIZE + SAFETY_MARGIN); + if(!inbuf || !outbuf) { + DEBUG(0,("cli_call_api: malloc fail.\n")); + return False; + } + if (pipe_name_len == 0) pipe_name_len = strlen(pipe_name); cli_send_trans_request(outbuf,SMBtrans,pipe_name, pipe_name_len, 0,0, @@ -152,6 +157,11 @@ BOOL cli_receive_trans_response(char *inbuf,int trans, *data = Realloc(*data,total_data); *param = Realloc(*param,total_param); + if((total_data && !data) || (total_param && !param)) { + DEBUG(0,("cli_receive_trans_response: Realloc fail !\n")); + return(False); + } + while (1) { this_data = SVAL(inbuf,smb_drcnt); @@ -458,10 +468,15 @@ BOOL cli_send_login(char *inbuf,char *outbuf,BOOL start_session,BOOL use_setup, bzero(&opt, sizeof(opt)); if (was_null) - { - inbuf = (char *)malloc(BUFFER_SIZE + SAFETY_MARGIN); - outbuf = (char *)malloc(BUFFER_SIZE + SAFETY_MARGIN); + { + inbuf = (char *)malloc(BUFFER_SIZE + SAFETY_MARGIN); + outbuf = (char *)malloc(BUFFER_SIZE + SAFETY_MARGIN); + + if(!inbuf || !outbuf) { + DEBUG(0,("cli_send_login: malloc fail !\n")); + return False; } + } if (strstr(service,"IPC$")) connect_as_ipc = True; |