summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c7
1 files changed, 4 insertions, 3 deletions
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;
}