From 97433611d662e984f888c52ff06f5f221365c04a Mon Sep 17 00:00:00 2001 From: Tristan Youngs Date: Fri, 16 Feb 2018 09:27:04 +0000 Subject: [PATCH] Fixed crash related to recent change in Atom::copy() and data_. --- src/base/atom.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/base/atom.cpp b/src/base/atom.cpp index 70ac9f0fa..391e2c5c0 100644 --- a/src/base/atom.cpp +++ b/src/base/atom.cpp @@ -492,6 +492,9 @@ void Atom::setData(const char* data) // Delete any old data and set new if (data_ != NULL) delete[] data_; data_ = NULL; + if (data == NULL) return; + + // Now copy data int len = strlen(data); if (len == 0) return; data_ = new char[len+1];