git://git.exim.org
/
users
/
heiko
/
exim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
DKIM: use Exim native memoory management
[users/heiko/exim.git]
/
src
/
exim_monitor
/
em_menu.c
diff --git
a/src/exim_monitor/em_menu.c
b/src/exim_monitor/em_menu.c
index 9d3ca1c14fe8dbf2340994a3319069deac947804..51a952e9920bdff1270322717f1a621b773004d4 100644
(file)
--- a/
src/exim_monitor/em_menu.c
+++ b/
src/exim_monitor/em_menu.c
@@
-2,7
+2,7
@@
* Exim Monitor *
*************************************************/
* Exim Monitor *
*************************************************/
-/* Copyright (c) University of Cambridge 1995 - 20
09
*/
+/* Copyright (c) University of Cambridge 1995 - 20
16
*/
/* See the file NOTICE for conditions of use and distribution. */
/* See the file NOTICE for conditions of use and distribution. */
@@
-273,8
+273,12
@@
if (pipe(pipe_fd) != 0)
return;
}
return;
}
-fcntl(pipe_fd[0], F_SETFL, O_NONBLOCK);
-fcntl(pipe_fd[1], F_SETFL, O_NONBLOCK);
+if ( fcntl(pipe_fd[0], F_SETFL, O_NONBLOCK)
+ || fcntl(pipe_fd[1], F_SETFL, O_NONBLOCK))
+ {
+ perror("set nonblocking on pipe");
+ exit(1);
+ }
/* Delivering a message can take some time, and we want to show the
output as it goes along. This requires subprocesses and is coded below. For
/* Delivering a message can take some time, and we want to show the
output as it goes along. This requires subprocesses and is coded below. For
@@
-373,7
+377,7
@@
if ((pid = fork()) == 0)
/* Main process - set up an item for the main ticker to watch. */
/* Main process - set up an item for the main ticker to watch. */
-if (pid < 0) text_showf(text, "Failed to fork: %s\n", strerror(
pid
)); else
+if (pid < 0) text_showf(text, "Failed to fork: %s\n", strerror(
errno
)); else
{
pipe_item *p = (pipe_item *)store_malloc(sizeof(pipe_item));
{
pipe_item *p = (pipe_item *)store_malloc(sizeof(pipe_item));
@@
-551,7
+555,8
@@
static void addrecipAction(Widget w, XtPointer client_data, XtPointer call_data)
{
w = w; /* Keep picky compilers happy */
call_data = call_data;
{
w = w; /* Keep picky compilers happy */
call_data = call_data;
-Ustrcpy(actioned_message, (uschar *)client_data);
+Ustrncpy(actioned_message, client_data, 24);
+actioned_message[23] = '\0';
action_required = US"-Mar";
dialog_ref_widget = menushell;
create_dialog(US"Recipient address to add?", US"");
action_required = US"-Mar";
dialog_ref_widget = menushell;
create_dialog(US"Recipient address to add?", US"");
@@
-567,7
+572,8
@@
static void markdelAction(Widget w, XtPointer client_data, XtPointer call_data)
{
w = w; /* Keep picky compilers happy */
call_data = call_data;
{
w = w; /* Keep picky compilers happy */
call_data = call_data;
-Ustrcpy(actioned_message, (uschar *)client_data);
+Ustrncpy(actioned_message, client_data, 24);
+actioned_message[23] = '\0';
action_required = US"-Mmd";
dialog_ref_widget = menushell;
create_dialog(US"Recipient address to mark delivered?", US"");
action_required = US"-Mmd";
dialog_ref_widget = menushell;
create_dialog(US"Recipient address to mark delivered?", US"");
@@
-582,7
+588,7
@@
static void markalldelAction(Widget w, XtPointer client_data, XtPointer call_dat
{
w = w; /* Keep picky compilers happy */
call_data = call_data;
{
w = w; /* Keep picky compilers happy */
call_data = call_data;
-ActOnMessage(
(uschar *)
client_data, US"-Mmad", US"");
+ActOnMessage(
US
client_data, US"-Mmad", US"");
}
}
@@
-597,9
+603,10
@@
queue_item *q;
uschar *sender;
w = w; /* Keep picky compilers happy */
call_data = call_data;
uschar *sender;
w = w; /* Keep picky compilers happy */
call_data = call_data;
-Ustrcpy(actioned_message, (uschar *)client_data);
+Ustrncpy(actioned_message, client_data, 24);
+actioned_message[23] = '\0';
q = find_queue(actioned_message, queue_noop, 0);
q = find_queue(actioned_message, queue_noop, 0);
-sender =
(q == NULL)? US"" : (q->sender[0] == 0)
? US"<>" : q->sender;
+sender =
!q ? US"" : q->sender[0] == 0
? US"<>" : q->sender;
action_required = US"-Mes";
dialog_ref_widget = menushell;
create_dialog(US"New sender address?", sender);
action_required = US"-Mes";
dialog_ref_widget = menushell;
create_dialog(US"New sender address?", sender);