summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1999-10-15 20:10:46 +0000
committerLuke Leighton <lkcl@samba.org>1999-10-15 20:10:46 +0000
commit63fa96e2168a98ead5e595134346650eece1c94e (patch)
tree2faff70741025c8090fdd9608f48f29c2b33d810 /source3
parent003f7364fd54ccdd190d447e275b70b0f76e95f7 (diff)
downloadsamba-63fa96e2168a98ead5e595134346650eece1c94e.tar.gz
samba-63fa96e2168a98ead5e595134346650eece1c94e.tar.bz2
samba-63fa96e2168a98ead5e595134346650eece1c94e.zip
added prs_struct "error" member, set and checked when prs_struct
data is handled. (This used to be commit b4ba49c5c114764247802bd8b0a6dbc0a7f5c2a1)
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_parse/parse_prs.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/source3/rpc_parse/parse_prs.c b/source3/rpc_parse/parse_prs.c
index 80e7eecf13..c50b1d1567 100644
--- a/source3/rpc_parse/parse_prs.c
+++ b/source3/rpc_parse/parse_prs.c
@@ -227,11 +227,8 @@ BOOL _prs_uint16s(BOOL charmode, char *name, prs_struct *ps, int depth, uint16 *
char *e;
if (ps->error) return False;
q = mem_data(&(ps->data), ps->offset);
- end_offset = ps->offset + len * sizeof(uint8);
+ end_offset = ps->offset + len * sizeof(uint16);
e = mem_data(&(ps->data), end_offset-1);
- char *q = mem_data(&(ps->data), ps->offset);
- int end_offset = ps->offset + len * sizeof(uint16);
- char *e = mem_data(&(ps->data), end_offset-1);
if (q == NULL || e == NULL)
{
@@ -255,7 +252,7 @@ BOOL _prs_uint32s(BOOL charmode, char *name, prs_struct *ps, int depth, uint32 *
char *e;
if (ps->error) return False;
q = mem_data(&(ps->data), ps->offset);
- end_offset = ps->offset + len * sizeof(uint8);
+ end_offset = ps->offset + len * sizeof(uint32);
e = mem_data(&(ps->data), end_offset-1);
if (q == NULL || e == NULL)
@@ -281,7 +278,7 @@ BOOL _prs_buffer2(BOOL charmode, char *name, prs_struct *ps, int depth, BUFFER2
char *e;
if (ps->error) return False;
q = mem_data(&(ps->data), ps->offset);
- end_offset = ps->offset + len * sizeof(uint8);
+ end_offset = ps->offset + str->buf_len;
e = mem_data(&(ps->data), end_offset-1);
if (q == NULL || e == NULL)
@@ -307,7 +304,7 @@ BOOL _prs_string2(BOOL charmode, char *name, prs_struct *ps, int depth, STRING2
char *e;
if (ps->error) return False;
q = mem_data(&(ps->data), ps->offset);
- end_offset = ps->offset + len * sizeof(uint8);
+ end_offset = ps->offset + str->str_str_len * sizeof(uint8);
e = mem_data(&(ps->data), end_offset-1);
if (q == NULL || e == NULL)
@@ -333,7 +330,7 @@ BOOL _prs_unistr2(BOOL charmode, char *name, prs_struct *ps, int depth, UNISTR2
char *e;
if (ps->error) return False;
q = mem_data(&(ps->data), ps->offset);
- end_offset = ps->offset + len * sizeof(uint8);
+ end_offset = ps->offset + str->uni_str_len * sizeof(uint16);
e = mem_data(&(ps->data), end_offset-1);
if (q == NULL || e == NULL)
@@ -359,7 +356,7 @@ BOOL _prs_unistr3(BOOL charmode, char *name, UNISTR3 *str, prs_struct *ps, int d
char *e;
if (ps->error) return False;
q = mem_data(&(ps->data), ps->offset);
- end_offset = ps->offset + len * sizeof(uint8);
+ end_offset = ps->offset + str->uni_str_len * sizeof(uint16);
e = mem_data(&(ps->data), end_offset-1);
if (q == NULL || e == NULL)