Skip to content

Fix empty Redis command array parsing#3354

Merged
chenBright merged 1 commit into
apache:masterfrom
wwbmmm:fix-empty-redis-command-array-parsing
Jun 21, 2026
Merged

Fix empty Redis command array parsing#3354
chenBright merged 1 commit into
apache:masterfrom
wwbmmm:fix-empty-redis-command-array-parsing

Conversation

@wwbmmm

@wwbmmm wwbmmm commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: null

Problem Summary:

The Redis command parser accepted an empty RESP array as the start of a command
and kept parsing subsequent bulk strings as array elements. Since an empty array
has no command name or arguments, this input should be rejected by the parser.

What is changed and the side effects?

Changed:

  • Reject empty RESP command arrays in RedisCommandParser.
  • Replace the internal array index CHECK with an explicit parse error before
    writing parsed bulk strings into the argument vector.
  • Add a parser regression test for empty RESP arrays followed by bulk strings.

Side effects:

  • Performance effects: None expected.

  • Breaking backward compatibility: Empty RESP arrays are now rejected as invalid
    Redis commands.


Check List:

@chenBright chenBright 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.

LGTM

@chenBright chenBright merged commit 1ba4286 into apache:master Jun 21, 2026
25 of 26 checks passed
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