Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for backslashes being replaced by null bytes #61

Merged
merged 1 commit into from
Jan 30, 2024

Conversation

RafBishopFox
Copy link
Contributor

This PR addresses #46. While testing Sliver, we noticed that the \ character was being consumed but not printed. Upon further investigation, it looks like backslashes were being replaced by null bytes (\x00). I tracked it down to the unescapeRunes function in inputrc/parse.go.

When the sequence of runes has a length of 1, the loop that reads ahead grabs zeroes for char1 through char5 and essentially interprets the sequence as trying to escape a null byte.

This PR returns a string representation of the sequence immediately if the length of the sequence is 1 to avoid this.

Copy link

codecov bot commented Jan 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (a558922) 89.29% compared to head (44a863d) 89.30%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master      #61   +/-   ##
=======================================
  Coverage   89.29%   89.30%           
=======================================
  Files          10       10           
  Lines        4736     4739    +3     
=======================================
+ Hits         4229     4232    +3     
  Misses        470      470           
  Partials       37       37           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@lesnuages lesnuages merged commit 6aca9b8 into reeflective:master Jan 30, 2024
10 of 11 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