diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2009-01-26 18:14:41 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2009-01-26 18:14:41 +0100 |
commit | cce04c606e7a91fcaf75c8efd7ca0cd4aa15ece9 (patch) | |
tree | 62f598c7a01e072cc52d166364bc3d2a94e85242 /source3/smbd/process.c | |
parent | d30b6af9532c0ea4e9610b30d13e7a4d9b763834 (diff) | |
parent | d8f15e4efc00b9d509ff5761e9ca8ff5c6f443f7 (diff) | |
download | samba-cce04c606e7a91fcaf75c8efd7ca0cd4aa15ece9.tar.gz samba-cce04c606e7a91fcaf75c8efd7ca0cd4aa15ece9.tar.xz samba-cce04c606e7a91fcaf75c8efd7ca0cd4aa15ece9.zip |
Merge branch 'master' of ssh://git.samba.org/data/git/samba
Diffstat (limited to 'source3/smbd/process.c')
-rw-r--r-- | source3/smbd/process.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source3/smbd/process.c b/source3/smbd/process.c index dc038b6b95..a025bb4197 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -1640,8 +1640,18 @@ void chain_reply(struct smb_request *req) /* * In req->chain_outbuf we collect all the replies. Start the * chain by copying in the first reply. + * + * We do the realloc because later on we depend on + * talloc_get_size to determine the length of + * chain_outbuf. The reply_xxx routines might have + * over-allocated (reply_pipe_read_and_X used to be such an + * example). */ - req->chain_outbuf = req->outbuf; + req->chain_outbuf = TALLOC_REALLOC_ARRAY( + req, req->outbuf, uint8_t, smb_len(req->outbuf) + 4); + if (req->chain_outbuf == NULL) { + goto error; + } req->outbuf = NULL; } else { if (!smb_splice_chain(&req->chain_outbuf, |