FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Release: v2.64.1 by CarterLi · Pull Request #2370 · fastfetch-cli/fastfetch · GitHub

Release: v2.64.1 - #2370

Merged
CarterLi merged 6 commits into
masterfrom
dev
Jun 4, 2026
Merged

Release: v2.64.1#2370
CarterLi merged 6 commits into
masterfrom
dev

Conversation

CarterLi commented Jun 4, 2026

Copy link
Copy Markdown
Member

Checklist

  • I have tested my changes locally.

Copilot AI review requested due to automatic review settings June 4, 2026 11:28

codacy-production Bot commented Jun 4, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

Not up to standards ⛔

🔴 Issues 3 critical

Alerts:
⚠ 3 issues (≤ 0 issues of at least minor severity)

Results:
3 new issues

Category Results
Security 3 critical

View in Codacy

🟢 Metrics 0 complexity

Metric Results
Complexity 0

View in Codacy

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

TIP This summary will be updated as you push new changes.

codacy-production Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Pull Request Overview

The PR is currently not up to standards due to 3 new quality issues and significant gaps in implementation that could break the build and compromise security.

A critical issue was identified in CMakeLists.txt where an empty package manager disable list causes a syntax error in the C header. Additionally, a high-severity security risk (CWE-126) exists in src/common/impl/format.c, where strlen is used on string arguments that may not be null-terminated.

Several acceptance criteria regarding the new recursion depth limit and CMake conditional compilation lack corresponding unit or regression tests. These issues should be resolved before merging.

About this PR

  • No unit tests or regression tests were included for the new recursion depth check or the CMake conditional compilation logic. These are critical for verifying the maintenance release's stability.
  • The PR description is sparse and lacks details on the actual logic changes. Furthermore, the recursion depth limit of 15 in lua.c is hardcoded; consider if this should be configurable or if it might be too restrictive for certain nested data structures.

Test suggestions

  • Verify that building with -DPACKAGES_REMOVE_DISABLED=ON excludes the detection code for managers disabled via -DPACKAGES_DISABLE_<NAME>.
  • Verify that json_encode in Lua correctly throws an error when a table exceeds a nesting depth of 15.
  • Verify that json_encode handles circular references gracefully without crashing.
  • Successful compilation and runtime verification using Lua 5.3.
  • Verification that Base64 decoding remains functional after making init_decode_table static.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Verify that building with `-DPACKAGES_REMOVE_DISABLED=ON` excludes the detection code for managers disabled via `-DPACKAGES_DISABLE_<NAME>`.
2. Verify that `json_encode` in Lua correctly throws an error when a table exceeds a nesting depth of 15.
3. Verify that `json_encode` handles circular references gracefully without crashing.
4. Successful compilation and runtime verification using Lua 5.3.
5. Verification that Base64 decoding remains functional after making `init_decode_table` static.

TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback

Comment thread CMakeLists.txt
list(JOIN PACKAGES_DISABLE_LIST " | " PACKAGES_DISABLE_LIST)
endif()
target_compile_definitions(libfastfetch PRIVATE FF_PACKAGES_DISABLE_LIST=${PACKAGES_DISABLE_LIST})
target_compile_definitions(libfastfetch PRIVATE "FF_PACKAGES_DISABLE_LIST=${PACKAGES_DISABLE_LIST}")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

🔴 HIGH RISK

This definition will cause a compilation error if PACKAGES_DISABLE_LIST is empty. You should ensure it defaults to a valid integer value or a bitmask flag that represents 'none' (e.g., FF_PACKAGES_FLAG_NONE) when the list is empty.

Try running the following prompt in your coding agent:

Update CMakeLists.txt to set PACKAGES_DISABLE_LIST to FF_PACKAGES_FLAG_NONE if it is empty before calling target_compile_definitions.

Comment thread src/common/impl/format.c
break;
case FF_ARG_TYPE_STRING:
lua_pushstring(L, (const char*) arg->value);
lua_pushlstring(L, (const char*) arg->value, strlen((const char*) arg->value));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

🔴 HIGH RISK

Replacing the internal string handler with strlen introduces a dependency on null-termination that might not be guaranteed for all FF_ARG_TYPE_STRING inputs. Try running the following prompt in your IDE agent:

Since lua_pushstring is no longer available in the FFLuaData struct, review the usage of strlen in src/common/impl/format.c at line 194. Ensure all string arguments are null-terminated or update the FFformatarg structure to carry an explicit length for string types to avoid potential buffer over-reads.

See Issue in Codacy

Comment thread src/common/impl/lua.c
if (!doc) {
return luaL_error(L, "failed to create yyjson document");
if (__builtin_expect(!doc, false)) {
lua_pushlstring(L, "yyjson: yyjson_mut_doc_new() failed", strlen("yyjson: yyjson_mut_doc_new() failed"));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

⚪ LOW RISK

Use sizeof for constant literals to provide the length at compile time.

Suggested change
lua_pushlstring(L, "yyjson: yyjson_mut_doc_new() failed", strlen("yyjson: yyjson_mut_doc_new() failed"));
lua_pushlstring(L, "yyjson: yyjson_mut_doc_new() failed", sizeof("yyjson: yyjson_mut_doc_new() failed") - 1);

See Issue in Codacy

Comment thread src/common/impl/lua.c
Comment on lines +11 to +14
lua_pushlstring(
L, ": recursion depth exceeded; possible circular reference",
strlen(": recursion depth exceeded; possible circular reference")
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

⚪ LOW RISK

Suggestion: Remove the leading colon from the error string for cleaner output (standard Lua errors do not start with a colon). Additionally, use sizeof for constant literals to calculate length at compile time rather than using strlen at runtime.

Suggested change
lua_pushlstring(
L, ": recursion depth exceeded; possible circular reference",
strlen(": recursion depth exceeded; possible circular reference")
);
sizeof(" recursion depth exceeded; possible circular reference") - 1

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Pull request overview

Release bump to v2.64.1, combining a small build-time optimization for package detection, Lua/yyjson robustness + compatibility fixes, and macOS codec build compatibility adjustments.

Changes:

  • Add PACKAGES_REMOVE_DISABLED / FF_PACKAGES_REMOVE_DISABLED to compile out detection code for package managers disabled at build time.
  • Improve Lua integration: fix Lua 5.3 compatibility and harden json_encode against deep/circular tables.
  • Fix older macOS SDK build issues by removing JPEG XL codec handling and using FourCC literals for Apple codec mappings.

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
CMakeLists.txt Bumps project version; adds PACKAGES_REMOVE_DISABLED option and wires FF_PACKAGES_* compile definitions.
CHANGELOG.md Adds 2.64.1 release notes for the new option and fixes.
src/modules/packages/option.h Makes FFPackagesFlags explicitly UINT64_C-based and conditionally removes disabled from options.
src/modules/packages/packages.c Conditionally compiles JSON parsing/config emission of disabled; initializes disabled defaults only when supported.
src/detection/packages/packages.h Introduces FF_PACKAGES_IS_ENABLED() abstraction (runtime vs compile-time depending on FF_PACKAGES_REMOVE_DISABLED).
src/detection/packages/packages_linux.c Switches per-manager checks to FF_PACKAGES_IS_ENABLED().
src/detection/packages/packages_windows.c Switches per-manager checks to FF_PACKAGES_IS_ENABLED().
src/detection/packages/packages_apple.c Switches per-manager checks to FF_PACKAGES_IS_ENABLED().
src/detection/packages/packages_bsd.c Switches per-manager checks to FF_PACKAGES_IS_ENABLED().
src/detection/packages/packages_obsd.c Switches per-manager checks to FF_PACKAGES_IS_ENABLED().
src/detection/packages/packages_nbsd.c Switches per-manager checks to FF_PACKAGES_IS_ENABLED().
src/detection/packages/packages_sunos.c Switches per-manager checks to FF_PACKAGES_IS_ENABLED().
src/detection/packages/packages_haiku.c Switches per-manager checks to FF_PACKAGES_IS_ENABLED().
src/detection/codec/codec.h Removes FF_CODEC_TYPE_JPEG_XL and updates FF_CODEC_TYPE_MAX.
src/modules/codec/codec.c Removes JPEG XL string mapping (consistent with enum removal).
src/detection/codec/codec_apple.c Uses FourCC literals to avoid relying on newer SDK constants; removes JPEG XL mapping.
src/common/lua.h Adjusts dynamically-loaded Lua symbol set and wrappers.
src/common/impl/lua.c Adds recursion-depth guard for json_encode and updates error paths to use lua_error.
src/common/impl/format.c Replaces lua_pushstring usage with lua_pushlstring for loaded-symbol consistency.
src/common/impl/base64.c Makes init_decode_table() static.

Comment thread src/common/impl/lua.c
Comment on lines +11 to +14
lua_pushlstring(
L, ": recursion depth exceeded; possible circular reference",
strlen(": recursion depth exceeded; possible circular reference")
);
CarterLi merged commit 021ece1 into master Jun 4, 2026
47 of 48 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

2 participants


Back | FazBrowse Home | New Git URL