summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-08-12 16:00:54 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:00:29 -0500
commitd04c1efd0ff130acbf17a0167a878cf27d9bdec5 (patch)
treeeeb5a8f6e532dffe896f187648450650615d9b82 /source3
parentdcf2200411f8a98eaee03b6fa235e1e9aa41b3f3 (diff)
downloadsamba-d04c1efd0ff130acbf17a0167a878cf27d9bdec5.tar.gz
samba-d04c1efd0ff130acbf17a0167a878cf27d9bdec5.tar.bz2
samba-d04c1efd0ff130acbf17a0167a878cf27d9bdec5.zip
r9264: fix valgrind invalid write error in enumprinterdata()
(This used to be commit bfebbc86fc0f90e580888da25006d8e5e50b6304)
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 692dacf159..5391ac5f41 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -8040,13 +8040,14 @@ WERROR _spoolss_enumprinterdata(pipes_struct *p, SPOOL_Q_ENUMPRINTERDATA *q_u, S
/* data - counted in bytes */
*out_max_data_len = in_data_len;
- if ( (*data_out = (uint8 *)TALLOC_ZERO(p->mem_ctx, in_data_len*sizeof(uint8))) == NULL)
+ if ( in_data_len && (*data_out = (uint8 *)TALLOC_ZERO(p->mem_ctx, in_data_len*sizeof(uint8))) == NULL)
{
result = WERR_NOMEM;
goto done;
}
data_len = regval_size(val);
- memcpy( *data_out, regval_data_p(val), data_len );
+ if ( *data_out )
+ memcpy( *data_out, regval_data_p(val), data_len );
*out_data_len = data_len;
}