mirror of
https://github.com/samba-team/samba.git
synced 2025-03-08 04:58:40 +03:00
a 0 length printer data value is not a memory allocation error; fix CR601
This commit is contained in:
parent
9151cd7d64
commit
47c1709425
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user