summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-03-30 22:25:08 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:19:01 -0500
commit261c004d7bf85de945a1a3956c1d8f15075bc224 (patch)
tree3bacb2553161bece2fe06d3a6c29a0f4b82de97c /source3/libsmb
parentb0bcb483697249123f92f5ac477c98b579135887 (diff)
downloadsamba-261c004d7bf85de945a1a3956c1d8f15075bc224.tar.gz
samba-261c004d7bf85de945a1a3956c1d8f15075bc224.tar.bz2
samba-261c004d7bf85de945a1a3956c1d8f15075bc224.zip
r22014: Make us pass RANDOMIPC test again :-(. This is an ugly check-in,
but I've no option. Jeremy. (This used to be commit c3a565081d70b209a4f9e6e8f1859bf7194a5f74)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/clidgram.c5
-rw-r--r--source3/libsmb/cliprint.c12
-rw-r--r--source3/libsmb/clirap.c18
-rw-r--r--source3/libsmb/clirap2.c4
4 files changed, 21 insertions, 18 deletions
diff --git a/source3/libsmb/clidgram.c b/source3/libsmb/clidgram.c
index a983f485ab..b6a9cfb31a 100644
--- a/source3/libsmb/clidgram.c
+++ b/source3/libsmb/clidgram.c
@@ -85,7 +85,10 @@ BOOL cli_send_mailslot(BOOL unique, const char *mailslot,
SSVAL(ptr,smb_vwv16,2);
p2 = smb_buf(ptr);
fstrcpy(p2,mailslot);
- p2 = skip_string(p2,1);
+ p2 = skip_string(ptr,MAX_DGRAM_SIZE,p2,1);
+ if (!p2) {
+ return False;
+ }
memcpy(p2,buf,len);
p2 += len;
diff --git a/source3/libsmb/cliprint.c b/source3/libsmb/cliprint.c
index 5798e94554..e33a3564eb 100644
--- a/source3/libsmb/cliprint.c
+++ b/source3/libsmb/cliprint.c
@@ -64,16 +64,16 @@ int cli_print_queue(struct cli_state *cli,
SSVAL(p,0,76); /* API function number 76 (DosPrintJobEnum) */
p += 2;
pstrcpy_base(p,"zWrLeh", param); /* parameter description? */
- p = skip_string(p,1);
+ p = skip_string(param,sizeof(param),p,1);
pstrcpy_base(p,"WWzWWDDzz", param); /* returned data format */
- p = skip_string(p,1);
+ p = skip_string(param,sizeof(param),p,1);
pstrcpy_base(p,cli->share, param); /* name of queue */
- p = skip_string(p,1);
+ p = skip_string(param,sizeof(param),p,1);
SSVAL(p,0,2); /* API function level 2, PRJINFO_2 data structure */
SSVAL(p,2,1000); /* size of bytes of returned data buffer */
p += 4;
pstrcpy_base(p,"", param); /* subformat */
- p = skip_string(p,1);
+ p = skip_string(param,sizeof(param),p,1);
DEBUG(4,("doing cli_print_queue for %s\n", cli->share));
@@ -133,9 +133,9 @@ int cli_printjob_del(struct cli_state *cli, int job)
SSVAL(p,0,81); /* DosPrintJobDel() */
p += 2;
pstrcpy_base(p,"W", param);
- p = skip_string(p,1);
+ p = skip_string(param,sizeof(param),p,1);
pstrcpy_base(p,"", param);
- p = skip_string(p,1);
+ p = skip_string(param,sizeof(param),p,1);
SSVAL(p,0,job);
p += 2;
diff --git a/source3/libsmb/clirap.c b/source3/libsmb/clirap.c
index 4be03e16f0..3fc95e8429 100644
--- a/source3/libsmb/clirap.c
+++ b/source3/libsmb/clirap.c
@@ -86,9 +86,9 @@ BOOL cli_NetWkstaUserLogon(struct cli_state *cli,char *user, char *workstation)
SSVAL(p,0,132); /* api number */
p += 2;
pstrcpy_base(p,"OOWb54WrLh",param);
- p = skip_string(p,1);
+ p = skip_string(param,sizeof(param),p,1);
pstrcpy_base(p,"WB21BWDWWDDDDDDDzzzD",param);
- p = skip_string(p,1);
+ p = skip_string(param,sizeof(param),p,1);
SSVAL(p,0,1);
p += 2;
pstrcpy_base(p,user,param);
@@ -147,9 +147,9 @@ int cli_RNetShareEnum(struct cli_state *cli, void (*fn)(const char *, uint32, co
SSVAL(p,0,0); /* api number */
p += 2;
pstrcpy_base(p,"WrLeh",param);
- p = skip_string(p,1);
+ p = skip_string(param,sizeof(param),p,1);
pstrcpy_base(p,"B13BWz",param);
- p = skip_string(p,1);
+ p = skip_string(param,sizeof(param),p,1);
SSVAL(p,0,1);
/*
* Win2k needs a *smaller* buffer than 0xFFFF here -
@@ -225,11 +225,11 @@ BOOL cli_NetServerEnum(struct cli_state *cli, char *workgroup, uint32 stype,
SSVAL(p,0,0x68); /* api number */
p += 2;
pstrcpy_base(p,"WrLehDz", param);
- p = skip_string(p,1);
+ p = skip_string(param,sizeof(param),p,1);
pstrcpy_base(p,"B16BBDz", param);
- p = skip_string(p,1);
+ p = skip_string(param,sizeof(param),p,1);
SSVAL(p,0,uLevel);
SSVAL(p,2,CLI_BUFFER_SIZE);
p += 4;
@@ -314,11 +314,11 @@ BOOL cli_oem_change_password(struct cli_state *cli, const char *user, const char
SSVAL(p,0,214); /* SamOEMChangePassword command. */
p += 2;
pstrcpy_base(p, "zsT", param);
- p = skip_string(p,1);
+ p = skip_string(param,sizeof(param),p,1);
pstrcpy_base(p, "B516B16", param);
- p = skip_string(p,1);
+ p = skip_string(param,sizeof(param),p,1);
pstrcpy_base(p,user, param);
- p = skip_string(p,1);
+ p = skip_string(param,sizeof(param),p,1);
SSVAL(p,0,532);
p += 2;
diff --git a/source3/libsmb/clirap2.c b/source3/libsmb/clirap2.c
index d6a44f4ea2..9ab8997871 100644
--- a/source3/libsmb/clirap2.c
+++ b/source3/libsmb/clirap2.c
@@ -91,7 +91,7 @@
/* put string s at p with max len n and increment p past string */
#define PUTSTRING(p,s,n) do {\
push_ascii(p,s?s:"",n?n:256,STR_TERMINATE);\
- p = skip_string(p,1);\
+ p = push_skip_string(p,1);\
} while(0)
/* put string s and p, using fixed len l, and increment p by l */
#define PUTSTRINGF(p,s,l) do {\
@@ -111,7 +111,7 @@
/* get asciiz string s from p, increment p past string */
#define GETSTRING(p,s) do {\
pull_ascii_pstring(s,p);\
- p = skip_string(p,1);\
+ p = push_skip_string(p,1);\
} while(0)
/* get fixed length l string s from p, increment p by l */
#define GETSTRINGF(p,s,l) do {\