[RTEMS Project] #3694: shm_open has logically unreachable code (Coverity ID: 1399706, 1399714) (was: shm_open has logically unreachable code (Coverity ID: 1399706))

RTEMS trac trac at rtems.org
Tue Feb 19 18:12:13 UTC 2019


#3694: shm_open has logically unreachable code (Coverity ID: 1399706, 1399714)
---------------------------+-----------------------
 Reporter:  Joel Sherrill  |       Owner:  Gedare
     Type:  defect         |      Status:  assigned
 Priority:  normal         |   Milestone:  5.1
Component:  fs             |     Version:  5
 Severity:  normal         |  Resolution:
 Keywords:  coverity       |  Blocked By:
 Blocking:                 |
---------------------------+-----------------------
Description changed by Joel Sherrill:

Old description:

> Coverity ID: 1399706
> File: shmopen.c
> Method: shm_open
>
> {{{
>         dead_error_condition: The condition oflag & 0 cannot be true.
> 289  if ( oflag & O_RDONLY ) {
>
> CID 1399706 (#1 of 1): Logically dead code (DEADCODE)
> dead_error_line: Execution cannot reach this statement: flags |= 2U;.
> 290    flags |= LIBIO_FLAGS_READ;
> 291  } else {
> }}}
>
> URL:
> https://scan5.coverity.com/reports.htm#v29811/p10069/fileInstanceId=153084281&defectInstanceId=42558012&mergedDefectId=1399706&fileStart=1&fileEnd=250

New description:

 Coverity ID: 1399706 and 1399714
 File: shmopen.c
 Method: shm_open for first

 {{{
         dead_error_condition: The condition oflag & 0 cannot be true.
 289  if ( oflag & O_RDONLY ) {

 CID 1399706 (#1 of 1): Logically dead code (DEADCODE)
 dead_error_line: Execution cannot reach this statement: flags |= 2U;.
 290    flags |= LIBIO_FLAGS_READ;
 291  } else {
 }}}

 URL:
 https://scan5.coverity.com/reports.htm#v29811/p10069/fileInstanceId=153084281&defectInstanceId=42558012&mergedDefectId=1399706&fileStart=1&fileEnd=250

 Same issue at other place in same file:

 {{{
 197  int flags;
         dead_error_condition: The condition oflag & 0 cannot be true.
 198  if ( oflag & O_RDONLY ) {

 CID 1399714 (#1 of 1): Logically dead code (DEADCODE)
 dead_error_line: Execution cannot reach this statement: flags = 4;.
 199    flags = RTEMS_FS_PERMS_READ;
 200  } else {
 }}}

--

--
Ticket URL: <http://devel.rtems.org/ticket/3694#comment:1>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list