Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F162626702
D53773.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D53773.diff
View Options
diff --git a/bin/sh/jobs.c b/bin/sh/jobs.c
--- a/bin/sh/jobs.c
+++ b/bin/sh/jobs.c
@@ -573,6 +573,7 @@
freejob(job);
else {
job->remembered = 0;
+ deljob(job);
if (job == bgjob)
bgjob = NULL;
}
@@ -599,7 +600,7 @@
break;
}
}
- } while (dowait(DOWAIT_BLOCK | DOWAIT_SIG, (struct job *)NULL) != -1);
+ } while (dowait(DOWAIT_BLOCK | DOWAIT_SIG, job) != -1);
sig = pendingsig_waitcmd;
pendingsig_waitcmd = 0;
diff --git a/bin/sh/tests/builtins/Makefile b/bin/sh/tests/builtins/Makefile
--- a/bin/sh/tests/builtins/Makefile
+++ b/bin/sh/tests/builtins/Makefile
@@ -188,5 +188,6 @@
${PACKAGE}FILES+= wait8.0
${PACKAGE}FILES+= wait9.127
${PACKAGE}FILES+= wait10.0
+${PACKAGE}FILES+= wait11.0
.include <bsd.test.mk>
diff --git a/bin/sh/tests/builtins/wait11.0 b/bin/sh/tests/builtins/wait11.0
new file mode 100644
--- /dev/null
+++ b/bin/sh/tests/builtins/wait11.0
@@ -0,0 +1,6 @@
+sleep 3 | sleep 2 &
+sleep 3 &
+kill %1
+wait %1
+r=$?
+[ "$r" -gt 128 ] && [ "$(kill -l "$r")" = TERM ]
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jul 16, 5:46 AM (27 m, 54 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35125517
Default Alt Text
D53773.diff (1 KB)
Attached To
Mode
D53773: sh: Fix a double free in a rare scenario with pipes
Attached
Detach File
Event Timeline
Log In to Comment