1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-26 10:04:02 +03:00

r3867: Fix from david.hu@hp.com - make a copy of an incoming message

rather than indirecting into it as a struct (may not be on an
even byte boundary). Bug #2052.
Jeremy.
(This used to be commit 8a91a69961622a31851f2394c591ddaa61a36000)
This commit is contained in:
Jeremy Allison 2004-11-18 22:46:04 +00:00 committed by Gerald (Jerry) Carter
parent 4a505a2860
commit 79f7373b33

View File

@ -1201,17 +1201,17 @@ this is the receive function of the background lpq updater
****************************************************************************/
static void print_queue_receive(int msg_type, pid_t src, void *buf, size_t len)
{
struct print_queue_update_context *ctx;
struct print_queue_update_context ctx;
if (len != sizeof(struct print_queue_update_context)) {
DEBUG(1, ("Got invalid print queue update message\n"));
return;
}
ctx = (struct print_queue_update_context*)buf;
print_queue_update_internal(ctx->sharename,
get_printer_fns_from_type(ctx->printing_type),
ctx->lpqcommand );
memcpy(&ctx, buf, sizeof(struct print_queue_update_context));
print_queue_update_internal(ctx.sharename,
get_printer_fns_from_type(ctx.printing_type),
ctx.lpqcommand );
}
static pid_t background_lpq_updater_pid = -1;