1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

Fix bug 7063 - Samba 3.4.5 on ubuntu 8.04 64 bit - Core dumps.

Reported and found by Martin Hochreiter <linuxbox@wavenet.at>.
Ensure we copy the right amount of registry data into the outgoing
buffer.

Jeremy.
This commit is contained in:
Jeremy Allison 2010-02-02 16:32:51 -08:00
parent 27920f4f90
commit 110a6f29f0

View File

@ -7634,8 +7634,15 @@ WERROR _spoolss_EnumPrinterData(pipes_struct *p,
/* data - counted in bytes */
if (r->out.data && regval_size(val)) {
memcpy(r->out.data, regval_data_p(val), regval_size(val));
/*
* See the section "Dynamically Typed Query Parameters"
* in MS-RPRN.
*/
if (r->out.data && regval_data_p(val) &&
regval_size(val) && r->in.data_offered) {
memcpy(r->out.data, regval_data_p(val),
MIN(regval_size(val),r->in.data_offered));
}
*r->out.data_needed = regval_size(val);