Skip to content

Conversation

sudo-bmitch
Copy link
Contributor

Fixes issue

Fixes #745.

Describe the change

Avoid updating the rdr value until after err is checked since an interface to a nil value is not nil. This also hardens the blob reader to prevent panics on a nil value.

How to verify it

regctl -v error image mod fluent/fluent-bit:1.8 --layer-compress none --create ocidir://fluent-bit:1.8

followed by pressing cont+c to cancel the blob read.

Changelog text

  • Fix: Prevent panic on interrupted image mod.

Please verify and check that the pull request fulfills the following requirements

  • Tests have been added or not applicable
  • Documentation has been added, updated, or not applicable
  • Changes have been rebased to main
  • Multiple commits to the same code have been squashed

Avoid updating the "rdr" value until after err is checked since an interface to a nil value is not nil.
This also hardens the blob reader to prevent panics on a nil value.

Signed-off-by: Brandon Mitchell <git@bmitch.net>
@sudo-bmitch sudo-bmitch merged commit 105aee1 into regclient:main May 20, 2024
@sudo-bmitch sudo-bmitch deleted the pr-nil-blob-reader branch May 20, 2024 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Issue] panic when received SIGINT
1 participant