From 49604b874bc181a6b1ecb6295487343504ff5778 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Fri, 28 Jun 2024 01:54:04 +0100 Subject: [PATCH] ensure we don't step past the NUL terminator here. --- src/vmrcli.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vmrcli.c b/src/vmrcli.c index 76d4241..4dc34f4 100644 --- a/src/vmrcli.c +++ b/src/vmrcli.c @@ -192,10 +192,10 @@ void interactive(T_VBVMR_INTERFACE *vmr) p++; continue; } - i = 0; log_trace("commands still in buffer: %s", p); - while (!isspace(*p)) + i = 0; + while (*p && !isspace(*p)) command[i++] = *p++; command[i] = '\0'; p++; /* shift to next char */