[rtems commit] sptests/spextensions01: Avoid NULL pointer access

Sebastian Huber sebh at rtems.org
Tue Jul 26 07:57:27 UTC 2016


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Tue Jul 26 09:26:19 2016 +0200

sptests/spextensions01: Avoid NULL pointer access

---

 testsuites/sptests/spextensions01/init.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/testsuites/sptests/spextensions01/init.c b/testsuites/sptests/spextensions01/init.c
index 7eac443..1d68255 100644
--- a/testsuites/sptests/spextensions01/init.c
+++ b/testsuites/sptests/spextensions01/init.c
@@ -48,7 +48,8 @@ static bool life_protected(void)
 
   executing = _Thread_Get_executing();
 
-  return (executing->Life.state & THREAD_LIFE_PROTECTED) != 0;
+  return executing == NULL
+    || (executing->Life.state & THREAD_LIFE_PROTECTED) != 0;
 }
 
 static void assert_normal_thread_context(void)



More information about the vc mailing list