Skip to content

Commit

Permalink
fix(asan): global-buffer-overflow in function escape_sds_argv of data…
Browse files Browse the repository at this point in the history
…_operations.cpp (#509)

Co-authored-by: HuangWei <[email protected]>
Co-authored-by: Wu Tao <[email protected]>
  • Loading branch information
3 people authored and neverchanje committed Apr 10, 2020
1 parent 9afc569 commit d8ac56b
Showing 1 changed file with 1 addition and 1 deletion.
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

0 comments on commit d8ac56b

Please sign in to comment.