From 9ddecc2164347edde5c727057e4aef43c2d7d2b7 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 8 Jan 2025 15:25:25 +0100 Subject: [PATCH] heap-buffer-overflow in mariadb-backup write of NULL ptr after the end of the allocated buffer --- extra/mariabackup/encryption_plugin.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extra/mariabackup/encryption_plugin.cc b/extra/mariabackup/encryption_plugin.cc index 04e8ae839575d..765e1488248d0 100644 --- a/extra/mariabackup/encryption_plugin.cc +++ b/extra/mariabackup/encryption_plugin.cc @@ -218,9 +218,10 @@ void encryption_plugin_prepare_init(int argc, char **argv) opt_plugin_dir[FN_REFLEN - 1] = '\0'; } - char **new_argv = new char *[argc + 1]; + char **new_argv = new char *[argc + 2]; new_argv[0] = XTRABACKUP_EXE; memcpy(&new_argv[1], argv, argc*sizeof(char *)); + new_argv[argc+1]= 0; encryption_plugin_init(argc+1, new_argv);