diff options
author | Jeremy Allison <jra@samba.org> | 2000-07-27 00:47:19 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2000-07-27 00:47:19 +0000 |
commit | 5ec1642809d9de83da8c88c65d6595c6eb0270f5 (patch) | |
tree | f6f4f1e0b3678394fca8b7c37f71084a1b166671 /source3/include/rpc_misc.h | |
parent | 134a4b86548db77cba292c50fbd6b91ecaa69f14 (diff) | |
download | samba-5ec1642809d9de83da8c88c65d6595c6eb0270f5.tar.gz samba-5ec1642809d9de83da8c88c65d6595c6eb0270f5.tar.bz2 samba-5ec1642809d9de83da8c88c65d6595c6eb0270f5.zip |
Ok - this is a *BIG* change - but it fixes the problems with static strings
in the RPC code. This change was prompted by trying to save a long (>256)
character comment in the printer properties page.
The new system associates a TALLOC_CTX with the pipe struct, and frees
the pool on return of a complete PDU.
A global TALLOC_CTX is used for the odd buffer allocated in the BUFFERxx
code, and is freed in the main loop.
This code works with insure, and seems to be free of memory leaks and
crashes (so far) but there are probably the occasional problem with
code that uses UNISTRxx structs on the stack and expects them to contain
storage without doing a init_unistrXX().
This means that rpcclient will probably be horribly broken.
A TALLOC_CTX also needed associating with the struct cli_state also,
to make the prs_xx code there work.
The main interface change is the addition of a TALLOC_CTX to the
prs_init calls - used for dynamic allocation in the prs_XXX calls.
Now this is in place it should make dynamic allocation of all RPC
memory on unmarshall *much* easier to fix.
Jeremy.
(This used to be commit 0ff2ce543ee54f7364e6d839db6d06e7ef1edcf4)
Diffstat (limited to 'source3/include/rpc_misc.h')
-rw-r--r-- | source3/include/rpc_misc.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index 5ef4044cb4..6e585e7a0e 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -125,7 +125,7 @@ typedef struct unihdr2_info typedef struct unistr_info { /* unicode characters. ***MUST*** be little-endian. ***MUST*** be null-terminated */ - uint16 buffer[MAX_UNISTRLEN]; + uint16 *buffer; } UNISTR; /* BUFHDR - buffer header */ @@ -145,7 +145,7 @@ typedef struct buffer2_info uint32 undoc; uint32 buf_len; /* unicode characters. ***MUST*** be little-endian. **NOT** necessarily null-terminated */ - uint16 buffer[MAX_UNISTRLEN]; + uint16 *buffer; } BUFFER2; @@ -153,7 +153,7 @@ typedef struct buffer2_info typedef struct buffer3_info { uint32 buf_max_len; - uint8 buffer[MAX_BUFFERLEN]; /* data */ + uint8 *buffer; /* Data */ uint32 buf_len; } BUFFER3; @@ -172,7 +172,7 @@ typedef struct unistr2_info uint32 undoc; uint32 uni_str_len; /* unicode characters. ***MUST*** be little-endian. **NOT** necessarily null-terminated */ - uint16 buffer[MAX_UNISTRLEN]; + uint16 *buffer; } UNISTR2; @@ -182,7 +182,7 @@ typedef struct string2_info uint32 str_max_len; uint32 undoc; uint32 str_str_len; - uint8 buffer[MAX_STRINGLEN]; /* uint8 characters. **NOT** necessarily null-terminated */ + uint8 *buffer; /* uint8 characters. **NOT** necessarily null-terminated */ } STRING2; |