-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
limit console cmd length #1870
limit console cmd length #1870
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
src/console/CliManager.cpp
Outdated
auto lineSize = line.size() - 1; | ||
if (lineSize > kMaxCmdLen) { | ||
cmdTooLarge = true; | ||
break; | ||
} | ||
line.resize(lineSize); | ||
cmd += line; | ||
if(cmd.length() > kMaxCmdLen) { | ||
cmdTooLarge = true; | ||
break; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only catch the case there are line breaks?
I think you could just check right before the command gets executed/processed.
Any progress about this pr? |
we should take it into consideration as a whole instead of just limiting the length of cmd. For example. r we gonna limit the length of string prop. Maybe do it at parser? 🤷♂️🤷♂️ |
<!-- Thanks for your contribution! In order to review PR more efficiently, please add information according to the template. --> ## What type of PR is this? - [X] bug - [ ] feature - [ ] enhancement ## What problem(s) does this PR solve? #### Issue(s) number: Close vesoft-inc#5020 #### Description: The `with *` in a match clause like `match ...(v999)... match ... match ... match ...(v999)... with *` from a multi-match query, where v999 is defined in a previous match, rebuilds named aliases from all query parts, causing v999 to duplicate and trigger a false error. This is actually ok, since they are in fact the same ones. There is actually no redefinition. This compiles with openCypher and neo4j. ## How do you solve it? 1. Allow the usage of aliases defined in previous matches. Only report redefinition of aliases if an alias is repeateed within the current query part. 2. Fixed an unstable tck case. ## Special notes for your reviewer, ex. impact of this fix, design document, etc: ## Checklist: Tests: - [ ] Unit test(positive and negative cases) - [ ] Function test - [ ] Performance test - [X] TCK Affects: - [ ] Documentation affected (Please add the label if documentation needs to be modified.) - [ ] Incompatibility (If it breaks the compatibility, please describe it and add the label.) - [ ] If it's needed to cherry-pick (If cherry-pick to some branches is required, please label the destination version(s).) - [ ] Performance impacted: Consumes more CPU/Memory ## Release notes: Please confirm whether to be reflected in release notes and how to describe: > ex. Fixed the bug ..... Migrated from vesoft-inc#5021 Co-authored-by: Cheng Xuntao <[email protected]>
For Security, Limit the max length of a single cmd.