[rtems commit] pipe/fifo.c: NULL dereference flagged by Coverity ID 1063889

Joel Sherril joel at rtems.org
Fri Nov 21 19:13:32 UTC 2014


Module:    rtems
Branch:    master
Commit:    abf3892c1a728229d052c4f1c8bda15f31b77cd0
Changeset: http://git.rtems.org/rtems/commit/?id=abf3892c1a728229d052c4f1c8bda15f31b77cd0

Author:    Joel Sherrill <joel.sherrill at oarcorp.com>
Date:      Thu Nov 20 17:22:22 2014 -0600

pipe/fifo.c: NULL dereference flagged by Coverity ID 1063889

It does not appear that this is possible so adding an assert.

---

 cpukit/libfs/src/pipe/fifo.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/cpukit/libfs/src/pipe/fifo.c b/cpukit/libfs/src/pipe/fifo.c
index 203b654..91d95dc 100644
--- a/cpukit/libfs/src/pipe/fifo.c
+++ b/cpukit/libfs/src/pipe/fifo.c
@@ -212,6 +212,7 @@ static int pipe_new(
   pipe_control_t *pipe;
   int err = 0;
 
+  _Assert( pipep );
   err = pipe_lock();
   if (err)
     return err;
@@ -223,7 +224,7 @@ static int pipe_new(
       goto out;
   }
 
-  if (! PIPE_LOCK(pipe))
+  if (!PIPE_LOCK(pipe))
     err = -EINTR;
 
   if (*pipep == NULL) {




More information about the vc mailing list