valkey icon indicating copy to clipboard operation
valkey copied to clipboard

Strictly check CRLF when parsing querybuf

Open enjoy-binbin opened this issue 1 month ago • 3 comments

Currently, when parsing querybuf, we are not checking for CRLF, instead we assume the last two characters are CRLF by default, as shown in the following example:

telnet 127.0.0.1 6379
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
*3
$3
set
$3
key
$5
value12
+OK
get key
$5
value

*3
$3
set
$3
key
$5
value12345
+OK
-ERR unknown command '345', with args beginning with:

This should actually be considered a protocol error. When a bug occurs in the client-side implementation, we may execute incorrect requests (writing incorrect data is the most serious of these).

enjoy-binbin avatar Nov 25 '25 08:11 enjoy-binbin

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 72.43%. Comparing base (d16788e) to head (693619b). :warning: Report is 22 commits behind head on unstable.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #2872      +/-   ##
============================================
- Coverage     72.45%   72.43%   -0.02%     
============================================
  Files           128      128              
  Lines         70485    70491       +6     
============================================
- Hits          51068    51063       -5     
- Misses        19417    19428      +11     
Files with missing lines Coverage Δ
src/networking.c 88.56% <100.00%> (+0.11%) :arrow_up:
src/server.h 100.00% <ø> (ø)

... and 9 files with indirect coverage changes

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Nov 26 '25 02:11 codecov[bot]

@enjoy-binbin any idea why the new fails?

ranshid avatar Nov 26 '25 13:11 ranshid

@enjoy-binbin any idea why the new fails?

The failures on fedora rawhide is this:

  • #2874

zuiderkwast avatar Nov 26 '25 14:11 zuiderkwast

@enjoy-binbin any idea why the new fails?

The failures on fedora rawhide is this:

@enjoy-binbin Can we just merge unstable so we can have a clean run? probably will be fine, but just to play on the safe side

ranshid avatar Nov 27 '25 11:11 ranshid

I looked at the test failures and it does not seem to be related. @enjoy-binbin lets go ahead with merging it WDYT?

ranshid avatar Dec 04 '25 18:12 ranshid

I looked at the test failures and it does not seem to be related. @enjoy-binbin lets go ahead with merging it WDYT?

yes, SGTM.

enjoy-binbin avatar Dec 04 '25 23:12 enjoy-binbin