From 7de0b5588e855a967f0a5094c515b955ff4a23cf Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 29 Sep 2000 21:15:45 +0000 Subject: Missing null termination on printer changenotify message caused insure error. Jeremy. (This used to be commit 3733d29ce678c71ef2ee8b600e547765d8d8ea9e) --- source3/rpc_server/srv_spoolss_nt.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source3/rpc_server/srv_spoolss_nt.c') diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index c281ccaacc..8996389039 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -584,11 +584,12 @@ static BOOL alloc_buffer_size(NEW_BUFFER *buffer, uint32 buffer_size) ****************************************************************************/ void srv_spoolss_receive_message(int msg_type, pid_t src, void *buf, size_t len) { - char printer[256]; + fstring printer; uint32 status; Printer_entry *find_printer; - memcpy(printer, buf, len); + *printer = '\0'; + fstrcpy(printer,buf); find_printer = (Printer_entry *)ubi_dlFirst(&Printer_list); @@ -630,7 +631,7 @@ static BOOL srv_spoolss_sendnotify(POLICY_HND *handle) fstrcpy(printer, ""); /*srv_spoolss_receive_message(printer);*/ - message_send_all(MSG_PRINTER_NOTIFY, printer, strlen(printer)); + message_send_all(MSG_PRINTER_NOTIFY, printer, strlen(printer) + 1); /* Null terminate... */ return True; } -- cgit