From: Christian Brabandt Date: Thu, 2 Jul 2026 19:36:42 +0000 (+0000) Subject: patch 9.2.0772: Vim9: Null dereference inside alloc_type() X-Git-Tag: v9.2.0772^0 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d5ec9f2e2c8694f12ba16eef1ce0fe002445bd37;p=thirdparty%2Fvim.git patch 9.2.0772: Vim9: Null dereference inside alloc_type() Problem: Vim9: Null dereference inside alloc_type(), Missing NULL check after ALLOC_ONE() (Ao Xijie) Solution: Check that the returned value from ALLOC_ONE() is not NULL related: #20668 Supported by AI. Signed-off-by: Christian Brabandt --- diff --git a/src/version.c b/src/version.c index 7fa823e7dc..2c4e9cf24c 100644 --- a/src/version.c +++ b/src/version.c @@ -759,6 +759,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 772, /**/ 771, /**/ diff --git a/src/vim9type.c b/src/vim9type.c index 1bd94a60cb..ab34d2535c 100644 --- a/src/vim9type.c +++ b/src/vim9type.c @@ -147,6 +147,8 @@ alloc_type(type_T *type) return type; ret = ALLOC_ONE(type_T); + if (ret == NULL) + return NULL; *ret = *type; if (ret->tt_member != NULL)