summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2000-10-18 01:15:05 +0000
committerTim Potter <tpot@samba.org>2000-10-18 01:15:05 +0000
commit282930d31f83e658573d1582d2ac89c98616ee2d (patch)
treeb8aa2cc820176f20581f214ae839592fed4fa9a5 /source3/rpc_server
parent60661e1d28056222753c37995ed3401acf28e747 (diff)
downloadsamba-282930d31f83e658573d1582d2ac89c98616ee2d.tar.gz
samba-282930d31f83e658573d1582d2ac89c98616ee2d.tar.bz2
samba-282930d31f83e658573d1582d2ac89c98616ee2d.zip
Merge of rpc parse buffer underflow debug code.
(This used to be commit c8d88713d9f7a646eb3b8e76bdd0250a3b89b722)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_pipe.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/source3/rpc_server/srv_pipe.c b/source3/rpc_server/srv_pipe.c
index fd5155a554..4cb57c69d8 100644
--- a/source3/rpc_server/srv_pipe.c
+++ b/source3/rpc_server/srv_pipe.c
@@ -1207,6 +1207,25 @@ BOOL api_rpcTNP(pipes_struct *p, char *rpc_name,
DEBUG(5,("api_rpcTNP: called %s successfully\n", rpc_name));
+ /* Check for buffer underflow in rpc parsing */
+
+ if ((DEBUGLEVEL >= 10) &&
+ (p->in_data.data.data_offset != p->in_data.data.buffer_size)) {
+ int data_len = p->in_data.data.buffer_size -
+ p->in_data.data.data_offset;
+ char *data;
+
+ data = malloc(data_len);
+
+ DEBUG(10, ("api_rpcTNP: rpc input buffer underflow (parse error?)\n"));
+ if (data) {
+ prs_uint8s(False, "", &p->in_data.data, 0, data,
+ data_len);
+ free(data);
+ }
+
+ }
+
return True;
}