Skip to content

[BUG] Separator module hangs when its string is empty #2689

Closed

Description

@arxhr007

Description

A separator module with an empty string makes fastfetch loop forever and never print anything. A string that is not a JSON string (a number, true, null, an array, an object) ends up empty too, so it hangs the same way.

Reproduce

{ "modules": [ { "type": "separator", "string": "" } ] }
$ fastfetch --config repro.jsonc
(hangs, 100% CPU)

"string": 5 and "string": [1] hang the same way.

Cause

In src/modules/separator/separator.c the width of the string is used as the step of a loop:

uint32_t wcsLength = ffUtf8StrWidth(options->string.chars, options->string.length);
int remaining = (int) titleLength;
for (; remaining >= (int) wcsLength; remaining -= (int) wcsLength) {

With an empty string wcsLength is 0, so remaining never changes and the loop never ends. If it did end, the fwrite(options->string.chars, (size_t) remaining, 1, stdout) below would read remaining bytes from an empty buffer.

Version

fastfetch 2.70.0 (dev at 0695787), Linux x86_64. I can send a fix: skip the repeat when the string has no width.

Activity

  1. added a commit that references this issue on Oct 30, 2026
    44b32e9
  2. added a commit that references this issue on Nov 6, 2026
    c9943cc
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