RTEMS | rtems_port_create should protect against zero length (#5649)

Avi Weiss (@thnkslprpt) gitlab at rtems.org
Thu Jul 16 09:14:39 UTC 2026



Issue created by Avi Weiss: https://gitlab.rtems.org/rtems/rtos/rtems/-/work_items/5649



## Summary
`rtems_port_create` should protect against zero length, similar to how `rtems_partition_create` does:  
```c
rtems_status_code rtems_partition_create(
  rtems_name      name,
  void           *starting_address,
  uintptr_t       length,
  size_t          buffer_size,
  rtems_attribute attribute_set,
  rtems_id       *id
)
{
  Partition_Control *the_partition;

  if ( !rtems_is_name_valid( name ) ) {
    return RTEMS_INVALID_NAME;
  }

  if ( id == NULL ) {
    return RTEMS_INVALID_ADDRESS;
  }

  if ( starting_address == NULL ) {
    return RTEMS_INVALID_ADDRESS;
  }

  if ( length == 0 ) {
    return RTEMS_INVALID_SIZE;
  }
...
```

## Steps to reproduce
Code review

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/work_items/5649
You're receiving this email because of your account on gitlab.rtems.org. Unsubscribe from this thread: https://gitlab.rtems.org/-/sent_notifications/4-7kokioaglthv30mmwj7zpqnuc-1d/unsubscribe | Manage all notifications: https://gitlab.rtems.org/-/profile/notifications | Help: https://gitlab.rtems.org/help


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20260716/c1487601/attachment-0001.htm>


More information about the bugs mailing list