Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Lack of argument checks leads to undefined behavior; Poor exception handling causes incorrect stack trace affecting scoop status #6251

Open
BinToss opened this issue Dec 20, 2024 · 0 comments
Labels

Comments

@BinToss
Copy link

BinToss commented Dec 20, 2024

Bug Report

Current Behavior

This is a 2-in-1 issue. A lack of argument sanitation led to empty strings being passed around and a related error was being discard with an empty error thrown instead.

Expected Behavior

Arguements should be checks for validity and errors should not be caught if they'll be rethrown or discarded and replaced.

Additional context/output

#6103 (comment)

Possible Solution

PR incoming...

  • If the return value of Get-ChildItem is a zero-length array, do not loop through the array.
  • Filter null, empty, and whitespace strings out of Get-ChildItem's return value
  • Do not rethrow or discard caught errors.

System details

Windows version: 11

OS architecture: 64bit

PowerShell version: 7.4.6

Additional software: git version 2.45.2.windows.1

Scoop Configuration

{
  "last_update": "2024-12-19T22:08:00.6529901-08:00",
  "alias": {
    "upgrade": "scoop-upgrade",
    "outdated": "scoop-outdated"
  },
  "scoop_branch": "develop",
  "scoop_repo": "https://github.com/ScoopInstaller/Scoop"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant