about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorPeter Stephenson <p.w.stephenson@ntlworld.com>2018-02-17 22:35:32 +0000
committerPeter Stephenson <p.w.stephenson@ntlworld.com>2018-02-17 22:35:32 +0000
commit5b946f6c4ddb82d2436c5012e719d470802987d0 (patch)
treefc0d0efcc662019c23d884b2a1fb8daffe77fe58 /Src
parent7492f1e9ed00b96df43bb307d4d3253ecea606d9 (diff)
downloadzsh-5b946f6c4ddb82d2436c5012e719d470802987d0.tar.gz
zsh-5b946f6c4ddb82d2436c5012e719d470802987d0.tar.xz
zsh-5b946f6c4ddb82d2436c5012e719d470802987d0.zip
42362: protect REPORTTIME logic from bad status
Diffstat (limited to 'Src')
-rw-r--r--Src/jobs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Src/jobs.c b/Src/jobs.c
index fc5bfacc6..503618f47 100644
--- a/Src/jobs.c
+++ b/Src/jobs.c
@@ -925,6 +925,7 @@ should_report_time(Job j)
     struct value vbuf;
     Value v;
     char *s = "REPORTTIME";
+    int save_errflag = errflag;
     zlong reporttime = -1;
 #ifdef HAVE_GETRUSAGE
     char *sm = "REPORTMEMORY";
@@ -936,12 +937,14 @@ should_report_time(Job j)
 	return 1;
 
     queue_signals();
+    errflag = 0;
     if ((v = getvalue(&vbuf, &s, 0)))
 	reporttime = getintvalue(v);
 #ifdef HAVE_GETRUSAGE
     if ((v = getvalue(&vbuf, &sm, 0)))
 	reportmemory = getintvalue(v);
 #endif
+    errflag = save_errflag;
     unqueue_signals();
     if (reporttime < 0
 #ifdef HAVE_GETRUSAGE