Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F168086662
D4126.id10314.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
593 B
Referenced Files
None
Subscribers
None
D4126.id10314.diff
View Options
Index: b/popen.c
===================================================================
--- b/popen.c
+++ b/popen.c
@@ -145,7 +145,6 @@
}
THREAD_UNLOCK();
- /* Parent; assume fdopen can't fail. */
if (*type == 'r') {
iop = fdopen(pdes[0], type);
(void)_close(pdes[1]);
@@ -154,6 +153,13 @@
(void)_close(pdes[0]);
}
+ /* Parent: adding check for fdopen failure. */
+ if (iop == NULL) {
+ (void)_close(pdes[(*type == 'r') ? 0 : 1]); /* close used pipe-end */
+ free(cur);
+ return (NULL);
+ }
+
/* Link into list of file descriptors. */
cur->fp = iop;
cur->pid = pid;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Aug 27, 7:49 AM (6 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37364989
Default Alt Text
D4126.id10314.diff (593 B)
Attached To
Mode
D4126: popen requires check for fdopen failure
Attached
Detach File
Event Timeline
Log In to Comment