Skip to content

paryplanner: set_partition_uuids eaks partition_plan` into the caller's scope #703

Description

@jmt-lab

[P2] set_partition_uuids (L573-594) leaks partition_plan into the caller's scope — missing local. (commenting near the UKI typecode change since L579 is not in the diff)

set_partition_uuids() {
  local -n pp_uuid
  pp_uuid="${1:?}"
  partition_plan="${2:?}"   # <-- L579, missing `local`

The sibling set_partition_sizes correctly declares local ... partition_plan (L235). Copy-paste drift.

Today the only callers use uppercase PARTITION_PLAN, so no collision, but any future caller (e.g. a helper inside img2img) with its own lowercase local partition_plan will find its value silently clobbered by this function via bash's dynamic scoping.

Fix: local partition_plan="${2:?}" on L579.

Originally posted by @jmt-lab in #701 (comment)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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