]> prime8.dev >> repos - ttyd.git/commitdiff
protocol: ignore resize message if process freed (#968)
authorDustin Martin <dustin@dmartin.io>
Tue, 23 Aug 2022 14:00:46 +0000 (07:00 -0700)
committerGitHub <noreply@github.com>
Tue, 23 Aug 2022 14:00:46 +0000 (22:00 +0800)
src/protocol.c

index 5341c3d38f6d391d4c486754d353a4d3878df4a2..cc0945b62f498eaf5471af3ab1e6cbbcffafa6c5 100644 (file)
@@ -314,6 +314,7 @@ int callback_tty(struct lws *wsi, enum lws_callback_reasons reason, void *user,
           }
           break;
         case RESIZE_TERMINAL:
+          if (pss->process == NULL) break;
           json_object_put(
               parse_window_size(pss->buffer + 1, pss->len - 1, &pss->process->columns, &pss->process->rows));
           pty_resize(pss->process);