rtems: Check entry point in rtems_task_start()

Close #4409.
This commit is contained in:
Sebastian Huber
2021-05-14 09:14:11 +02:00
parent d697769d46
commit 06427c8df4
2 changed files with 13 additions and 0 deletions

View File

@@ -41,6 +41,10 @@ rtems_status_code rtems_task_start(
ISR_lock_Context lock_context;
bool ok;
if ( entry_point == NULL ) {
return RTEMS_INVALID_ADDRESS;
}
the_thread = _Thread_Get( id, &lock_context );
if ( the_thread == NULL ) {

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(