1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-29 13:49:30 +03:00

s3-spoolss: disallow storing an invalid devmode size.

Guenther
This commit is contained in:
Günther Deschner
2011-01-19 13:49:51 +01:00
parent aefbec5270
commit 9b1878e538

View File

@ -1773,6 +1773,12 @@ WERROR winreg_update_printer(TALLOC_CTX *mem_ctx,
goto done;
}
}
if (devmode->size != (ndr_size_spoolss_DeviceMode(devmode, 0) - devmode->__driverextra_length)) {
result = WERR_INVALID_PARAM;
goto done;
}
ndr_err = ndr_push_struct_blob(&blob, tmp_ctx, devmode,
(ndr_push_flags_fn_t) ndr_push_spoolss_DeviceMode);
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {