From 70af46a24d6f5fac12a7defce3e080137056f880 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deuc=D0=B5?= <shurd@sasktel.net> Date: Wed, 28 Jun 2023 13:00:05 -0400 Subject: [PATCH] Fix for b593c251d The commit just the zero-length behaviour from uninitialized use with possible undefined behaviour to guaranteed undefined behaviour. --- src/conio/cterm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/conio/cterm.c b/src/conio/cterm.c index d620905f03..1648e55c60 100644 --- a/src/conio/cterm.c +++ b/src/conio/cterm.c @@ -2045,6 +2045,8 @@ all_done: size_t mlen = 0; char *out; + if (end == NULL) + return; // First, calculate the required length... for (p = cterm->strbuf; p <= end;) { if (*p == '!') { -- GitLab