summaryrefslogtreecommitdiffstats
path: root/testsuites/fstests
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-10-08 11:24:36 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-10-08 11:26:27 +0200
commit22cd2821de2dcec7117fa0370a495e675de206a4 (patch)
tree4448ed74d0951eb5c6f80347a7d579c93073dfa6 /testsuites/fstests
parentposix: Add auto initializaton for rwlock (diff)
downloadrtems-22cd2821de2dcec7117fa0370a495e675de206a4.tar.bz2
IMFS: Avoid NULL pointer access
Avoid NULL pointer access in IMFS_is_imfs_instance(). File systems mounted via mount() always have a valid type string.
Diffstat (limited to 'testsuites/fstests')
-rw-r--r--testsuites/fstests/fsimfsgeneric01/init.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/testsuites/fstests/fsimfsgeneric01/init.c b/testsuites/fstests/fsimfsgeneric01/init.c
index 09e7ed67f8..40f0aed70a 100644
--- a/testsuites/fstests/fsimfsgeneric01/init.c
+++ b/testsuites/fstests/fsimfsgeneric01/init.c
@@ -472,6 +472,17 @@ static void test_imfs_make_generic_node_errors(void)
rtems_test_assert(rv == -1);
rtems_test_assert(errno == EIO);
rtems_test_assert(rtems_resource_snapshot_check(&before));
+
+ errno = 0;
+ rv = IMFS_make_generic_node(
+ "/nil/nada",
+ S_IFCHR | S_IRWXU | S_IRWXG | S_IRWXO,
+ &node_control,
+ NULL
+ );
+ rtems_test_assert(rv == -1);
+ rtems_test_assert(errno == ENOENT);
+ rtems_test_assert(rtems_resource_snapshot_check(&before));
}
static void Init(rtems_task_argument arg)