summaryrefslogtreecommitdiff
path: root/source3/printing
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-11-18 22:46:04 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:53:22 -0500
commit79f7373b3370b6629ac3aa309bc59c543599d0e9 (patch)
tree1551b76e25415c339b0920fa0e7bc624bc519515 /source3/printing
parent4a505a2860c08c8223b44507e212a4ce5e433bea (diff)
downloadsamba-79f7373b3370b6629ac3aa309bc59c543599d0e9.tar.gz
samba-79f7373b3370b6629ac3aa309bc59c543599d0e9.tar.bz2
samba-79f7373b3370b6629ac3aa309bc59c543599d0e9.zip
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)
Diffstat (limited to 'source3/printing')
-rw-r--r--source3/printing/printing.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source3/printing/printing.c b/source3/printing/printing.c
index 1e897c962a..ca83945065 100644
--- a/source3/printing/printing.c
+++ b/source3/printing/printing.c
@@ -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;