Skip to content

Commit

Permalink
Ensure that ensure_space does not leave a NULL pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
kovidgoyal committed Jun 24, 2019
1 parent ba1c093 commit f4f54b1
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 80 deletions.
19 changes: 0 additions & 19 deletions asan-launcher.c

This file was deleted.

2 changes: 1 addition & 1 deletion kittens/choose/output.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ static inline ssize_t ms_write(int fd, const void* buf, size_t count) { return _

static inline bool
ensure_space(GlobalData *global, size_t sz) {
if (global->output_sz < sz + global->output_pos) {
if (global->output_sz < sz + global->output_pos || !global->output) {
size_t before = global->output_sz;
global->output_sz += MAX(sz, (64 * 1024));
global->output = realloc(global->output, sizeof(text_t) * global->output_sz);
Expand Down
13 changes: 0 additions & 13 deletions kitty/launcher/kitty

This file was deleted.

47 changes: 0 additions & 47 deletions symlink-deref.c

This file was deleted.

1 comment on commit f4f54b1

@Luflosi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You deleted a bunch of stuff.

Please sign in to comment.