From 32d7a15366dc6d0b94e469f5ced6dd80fa47d130 Mon Sep 17 00:00:00 2001 From: Sandeep Mistry Date: Tue, 6 Sep 2016 14:06:34 -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 73a96f9f..ce4e4f85 100644 --- a/cores/arduino/WString.cpp +++ b/cores/arduino/WString.cpp @@ -227,7 +227,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;