summaryrefslogtreecommitdiff
path: root/source3/rpc_parse/parse_prs.c
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2003-04-22 15:54:36 +0000
committerVolker Lendecke <vlendec@samba.org>2003-04-22 15:54:36 +0000
commite15dfd44c912bf9a567a13cbbec63c4ecbabaed4 (patch)
tree9c74301c5971c44c804f394d3823bd732ac18e2c /source3/rpc_parse/parse_prs.c
parentbabd260262e4bd41f40b1bdf9391e10b10a5239a (diff)
downloadsamba-e15dfd44c912bf9a567a13cbbec63c4ecbabaed4.tar.gz
samba-e15dfd44c912bf9a567a13cbbec63c4ecbabaed4.tar.bz2
samba-e15dfd44c912bf9a567a13cbbec63c4ecbabaed4.zip
parse_string is only used for the authentication negotiators.
It can itself determine the length of the string it has to transfer. Andrew B., could you take a look at the length calculation? Is that safe? Thanks, Volker (This used to be commit 0ef69b586a8f1fa11a41a3900180ea2090b60bfd)
Diffstat (limited to 'source3/rpc_parse/parse_prs.c')
-rw-r--r--source3/rpc_parse/parse_prs.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source3/rpc_parse/parse_prs.c b/source3/rpc_parse/parse_prs.c
index 696142905b..e0a75d7382 100644
--- a/source3/rpc_parse/parse_prs.c
+++ b/source3/rpc_parse/parse_prs.c
@@ -1159,10 +1159,16 @@ BOOL prs_unistr(const char *name, prs_struct *ps, int depth, UNISTR *str)
not include the null-termination character.
********************************************************************/
-BOOL prs_string(const char *name, prs_struct *ps, int depth, char *str, int len, int max_buf_size)
+BOOL prs_string(const char *name, prs_struct *ps, int depth, char *str, int max_buf_size)
{
char *q;
int i;
+ int len;
+
+ if (UNMARSHALLING(ps))
+ len = strlen(&ps->data_p[ps->data_offset]);
+ else
+ len = strlen(str);
len = MIN(len, (max_buf_size-1));