Skip to content

Error handling in C callbacks #125

Description

@robin-nitrokey

Context: #124

We should return an error in these cases:

  • conversion from u32 to usize fails
  • offset calculation overflows
  • block exceeds the configured block count

I think LFS_ERR_INVAL would be an appropriate error code.

In a second step, we should make sure that overflows cannot happen by validating the lengths in Allocation::with_config.

@sosthene-nitrokey What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions