From 5ff8b9fe668544911d33451b0970182816f0aceb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Deuc=D0=B5?= <shurd@sasktel.net>
Date: Sun, 5 Jan 2025 01:39:12 -0500
Subject: [PATCH] Another NULL dereference after overrunning the string buf.

Found by scan-build
---
 src/conio/cterm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/conio/cterm.c b/src/conio/cterm.c
index 0311ceaebf..a9f93934b0 100644
--- a/src/conio/cterm.c
+++ b/src/conio/cterm.c
@@ -5701,6 +5701,7 @@ CIOLIBEXPORT char* cterm_write(struct cterminal * cterm, const void *vbuf, int b
 											FREE_AND_NULL(cterm->strbuf);
 											cterm->string = 0;
 											cterm->strbuflen = cterm->strbufsize = 0;
+											break;
 										}
 										else {
 											p = realloc(cterm->strbuf, cterm->strbufsize);
-- 
GitLab