svn commit: samba r3866 - in trunk/source/printing: .

jra at samba.org jra at samba.org
Thu Nov 18 22:45:58 GMT 2004


Author: jra
Date: 2004-11-18 22:45:58 +0000 (Thu, 18 Nov 2004)
New Revision: 3866

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=3866

Log:
Fix from david.hu at 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.
WARNING ! This code is different from 3.0.x. Someone needs to
look at this (Jerry?).
Jeremy.

Modified:
   trunk/source/printing/printing.c


Changeset:
Modified: trunk/source/printing/printing.c
===================================================================
--- trunk/source/printing/printing.c	2004-11-18 22:11:20 UTC (rev 3865)
+++ trunk/source/printing/printing.c	2004-11-18 22:45:58 UTC (rev 3866)
@@ -1173,15 +1173,15 @@
 ****************************************************************************/
 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 *)buf;
-	print_queue_update_internal(ctx);
+	memcpy(&ctx, buf, sizeof(struct print_queue_update_context));
+	print_queue_update_internal(&ctx);
 }
 
 static pid_t background_lpq_updater_pid = -1;



More information about the samba-cvs mailing list