rtems: Check entry point in rtems_task_start()

Close #4410.
This commit is contained in:
Sebastian Huber
2021-05-14 09:20:26 +02:00
parent 410317ae3a
commit b87d2a6364
2 changed files with 13 additions and 0 deletions
+4
View File
@@ -43,6 +43,10 @@ rtems_status_code rtems_task_start(
ISR_lock_Context lock_context;
Status_Control status;
if ( entry_point == NULL ) {
return RTEMS_INVALID_ADDRESS;
}
the_thread = _Thread_Get( id, &lock_context );
if ( the_thread == NULL ) {
+9
View File
@@ -165,6 +165,15 @@ rtems_task Task_1(
);
puts( "TA1 - rtems_task_start - RTEMS_INVALID_ID" );
/* NULL entry point */
status = rtems_task_start( RTEMS_SELF, NULL, 0 );
fatal_directive_status(
status,
RTEMS_INVALID_ADDRESS,
"rtems_task_start with NULL entry point"
);
puts( "TA1 - rtems_task_start - RTEMS_INVALID_ADDRESS" );
/* already started */
status = rtems_task_start( RTEMS_SELF, Task_1, 0 );
fatal_directive_status(