summaryrefslogtreecommitdiffstats
path: root/source/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
commit8a91a69961622a31851f2394c591ddaa61a36000 (patch)
treecb7f479ff584da16695b080b3f7a82b9b2f89177 /source/printing
parente3ca22b80dc1c22f0e5c829d11724c79e317641f (diff)
downloadsamba-8a91a69961622a31851f2394c591ddaa61a36000.tar.gz
samba-8a91a69961622a31851f2394c591ddaa61a36000.tar.xz
samba-8a91a69961622a31851f2394c591ddaa61a36000.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.
Diffstat (limited to 'source/printing')
-rw-r--r--source/printing/printing.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/printing/printing.c b/source/printing/printing.c
index 1e897c962a6..ca839450658 100644
--- a/source/printing/printing.c
+++ b/source/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;