From 40e5a4fcee373e8ec3e666b35a3020f0d9bf31c0 Mon Sep 17 00:00:00 2001 From: Sandeep Mistry Date: Tue, 12 Jul 2016 17:42:40 -0400 Subject: [PATCH] Make String::move of an invalidated String result in an invalidated String --- cores/arduino/WString.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cores/arduino/WString.cpp b/cores/arduino/WString.cpp index e1d60f471..533298225 100644 --- a/cores/arduino/WString.cpp +++ b/cores/arduino/WString.cpp @@ -195,7 +195,7 @@ String & String::copy(const __FlashStringHelper *pstr, unsigned int length) void String::move(String &rhs) { if (buffer) { - if (capacity >= rhs.len) { + if (rhs && capacity >= rhs.len) { strcpy(buffer, rhs.buffer); len = rhs.len; rhs.len = 0;