Skip to content

Commit 3e2654c

Browse files
proh14adsr
authored andcommitted
Fixed potential zero size memory allocation in the cmd_replace_all function
1 parent 36d1255 commit 3e2654c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

cmd.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,7 @@ int cmd_replace_all(cmd_context_t *ctx) {
522522
regex = NULL;
523523
replacement = NULL;
524524
CDL_COUNT2(ctx->editor->all_bviews, bview, num_bviews, all_next);
525+
if (num_bviews <= 0) return MLE_OK;
525526
buffer_done = calloc(num_bviews, sizeof(buffer_t *));
526527
buffer_done_i = 0;
527528

0 commit comments

Comments
 (0)