diff --git a/dwarf/cursor.cc b/dwarf/cursor.cc index 19902da..f5a4193 100644 --- a/dwarf/cursor.cc +++ b/dwarf/cursor.cc @@ -86,7 +86,9 @@ cursor::string(std::string &out) size_t size; const char *p = this->cstr(&size); out.resize(size); - memmove(&out.front(), p, size); + if (size > 0) { + memmove(&out.front(), p, size); + } } const char *