[rtems commit] imfs/imfs_handlers_link.c: Add _Assert for NULL pointer
Joel Sherril
joel at rtems.org
Wed Nov 26 13:55:51 UTC 2014
Module: rtems
Branch: master
Commit: 4862532fd9669485797f83508a6cb6d6774a5b1f
Changeset: http://git.rtems.org/rtems/commit/?id=4862532fd9669485797f83508a6cb6d6774a5b1f
Author: Josh Oguin <josh.oguin at oarcorp.com>
Date: Wed Nov 19 14:40:16 2014 -0600
imfs/imfs_handlers_link.c: Add _Assert for NULL pointer
CodeSonar flagged this as a possible dereference of a NULL pointer.
This should never occur so adding _Assert().
---
cpukit/libfs/src/imfs/imfs_handlers_link.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/cpukit/libfs/src/imfs/imfs_handlers_link.c b/cpukit/libfs/src/imfs/imfs_handlers_link.c
index 7c2a341..cd71f95 100644
--- a/cpukit/libfs/src/imfs/imfs_handlers_link.c
+++ b/cpukit/libfs/src/imfs/imfs_handlers_link.c
@@ -78,6 +78,8 @@ static IMFS_jnode_t *IMFS_node_remove_hard_link(
{
IMFS_jnode_t *target = node->info.hard_link.link_node;
+ _Assert( target != NULL );
+
if ( target->st_nlink == 1) {
target = (*target->control->node_remove)( target );
if ( target == NULL ) {
More information about the vc
mailing list