From 20d3b65cdf801726598c46f85754187f5118757d Mon Sep 17 00:00:00 2001 From: s1lentq Date: Wed, 18 Jan 2017 08:47:21 +0700 Subject: [PATCH] Fix crash due to NULL pointer access. --- metamod/src/mreg.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metamod/src/mreg.cpp b/metamod/src/mreg.cpp index f317938..4a9f423 100644 --- a/metamod/src/mreg.cpp +++ b/metamod/src/mreg.cpp @@ -149,7 +149,7 @@ void MRegCmdList::show(int plugin_id) const META_CONS("%d commands", total_count); } -MRegCvar::MRegCvar(cvar_t* cv_ptr, MPlugin* cv_plugin) : m_cvar(cv_ptr), m_plugid(cv_plugin->m_index), m_status(RG_VALID) +MRegCvar::MRegCvar(cvar_t* cv_ptr, MPlugin* cv_plugin) : m_cvar(cv_ptr), m_plugid(cv_plugin ? cv_plugin->m_index : 0), m_status(RG_VALID) { m_cvar = new cvar_t; m_cvar->name = Q_strdup(cv_ptr->name);