diff options
Diffstat (limited to 'source3')
-rw-r--r-- | source3/rpc_server/srv_spoolss_nt.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index 291ed50ddd..279bbb86ff 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -2104,8 +2104,16 @@ static WERROR get_printer_dataex( TALLOC_CTX *ctx, NT_PRINTER_INFO_LEVEL *printe if ( in_size ) { data_len = (size > in_size) ? in_size : size*sizeof(uint8); - if ( (*data = (uint8 *)talloc_memdup(ctx, regval_data_p(val), data_len)) == NULL ) - return WERR_NOMEM; + + /* special case for 0 length values */ + if ( data_len ) { + if ( (*data = (uint8 *)talloc_memdup(ctx, regval_data_p(val), data_len)) == NULL ) + return WERR_NOMEM; + } + else { + if ( (*data = (uint8 *)talloc_zero(ctx, in_size)) == NULL ) + return WERR_NOMEM; + } } else *data = NULL; |