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(asan): global-buffer-overflow in function escape_sds_argv of data_operations.cpp #509

Merged
merged 6 commits into from
Apr 2, 2020
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/shell/commands/data_operations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2430,7 +2430,7 @@ void escape_sds_argv(int argc, sds *argv)
{
for (int i = 0; i < argc; i++) {
const size_t dest_len = sdslen(argv[i]) * 4 + 1; // Maximum possible expansion
sds new_arg = sdsnewlen("", dest_len);
sds new_arg = sdsnewlen(NULL, dest_len);
pegasus::utils::c_escape_string(argv[i], sdslen(argv[i]), new_arg, dest_len);
sdsfree(argv[i]);
argv[i] = new_arg;
Expand Down