From d6aab01b08fc406a4255b8f3a93e867bcf8603e2 Mon Sep 17 00:00:00 2001 From: prozacx Date: Sun, 26 Mar 2006 20:45:27 +0000 Subject: [PATCH] Don't try to copy from a null source git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@716 726aef4b-f618-498e-8847-2d620e286838 --- Utils.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Utils.h b/Utils.h index 9f9c22ae..28f302df 100644 --- a/Utils.h +++ b/Utils.h @@ -502,6 +502,11 @@ public: CSmartPtr& operator =(const CSmartPtr& CopyFrom) { if (&CopyFrom != this) { // Check for assignment to self Release(); // Release the current pointer + + if (CopyFrom.IsNull()) { // If the source raw pointer is null + return *this; // Then just bail out + } + m_pType = &(*CopyFrom); // Make our pointers reference the same raw pointer and counter m_puCount = CopyFrom.GetCount();