Opened 7 years ago

Closed 6 years ago

Last modified 6 years ago

#11607 closed Patch - Bug Fix (fixed)

Patch to close dup2(ed) file descriptor in mythsystemunix.cpp - fixes 1028694

Reported by: Gary Buhrmaster <gary.buhrmaster@…> Owned by: stuartm
Priority: minor Milestone: 0.27
Component: MythTV - General Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

This patch should probably be reviewed by beirdo who wrote the code.

Tested only via the unit tests.

The patch closes the file descriptor assgined by open if it is not the same as the newfd in dup2. Looks to be a real bug.

Fixes coverity 1028694

(It seems likely that coverity will not agree that it is fixed, since it will not recognize the belt and suspenders checking of the fd being the value dup'ed to).

github patch: https://github.com/garybuhrmaster/mythtv/commit/959a807ce4f1753e95fdc0dffc4fe24b19a991a2

git-am patch: https://github.com/garybuhrmaster/mythtv/commit/959a807ce4f1753e95fdc0dffc4fe24b19a991a2.patch

Change History (5)

comment:1 Changed 7 years ago by stuartm

Owner: set to danielk
Status: newassigned

comment:2 Changed 7 years ago by paulh

Milestone: unknown0.27

comment:3 Changed 7 years ago by stuartm

Owner: changed from danielk to stuartm
Status: assignedaccepted

comment:4 Changed 6 years ago by Gary Buhrmaster <gary.buhrmaster@…>

Resolution: fixed
Status: acceptedclosed

In 18fdd0b3fd02a3c815d9d111277973cd14fa42a1/mythtv:

Close file descriptor after dup2

Close the file descriptor assgined by open if it
is not the same as the newfd.

Fixes coverity 1028694
Fixes #11607

(It seems likely that coverity will not agree that it is
fixed, since it will not recognize the belt and suspenders
checking of the fd being the value dup'ed to).

Signed-off-by: Stuart Morgan <smorgan@…>

comment:5 Changed 6 years ago by Gary Buhrmaster <gary.buhrmaster@…>

In 3841da58be46cc1f0b915f7b9ef6a894227d8387/mythtv:

Close file descriptor after dup2

Close the file descriptor assgined by open if it
is not the same as the newfd.

Fixes coverity 1028694
Fixes #11607

(It seems likely that coverity will not agree that it is
fixed, since it will not recognize the belt and suspenders
checking of the fd being the value dup'ed to).

Signed-off-by: Stuart Morgan <smorgan@…>
(cherry picked from commit 18fdd0b3fd02a3c815d9d111277973cd14fa42a1)

Note: See TracTickets for help on using tickets.