Skip to content

Commit

Permalink
package_managers: yarn: _resolve_package: Initialize 'name' & 'version'
Browse files Browse the repository at this point in the history
Although impossible (with the assert_never sink) CodeQL still reports
them as potentially being uninitialized.

Resolves: https://github.com/containerbuildsystem/cachi2/security/code-scanning/170
Resolves: https://github.com/containerbuildsystem/cachi2/security/code-scanning/169

Signed-off-by: Erik Skultety <eskultet@redhat.com>
  • Loading branch information
eskultety committed Aug 1, 2024
1 parent 36b011c commit 05e8654
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cachi2/core/package_managers/yarn/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,8 @@ def log_for_locator(msg: str, *args: Any, level: int = logging.DEBUG) -> None:

locator = package.parsed_locator
checksum = package.checksum
name = None
version = None

if isinstance(locator, NpmLocator):
# npm dependencies have reliable names and versions in yarn info output
Expand Down

0 comments on commit 05e8654

Please sign in to comment.