getString() on a NULL pointer is an empty string (verified in SCI2.1)

svn-id: r50591
This commit is contained in:
Filippos Karapetis 2010-07-02 08:53:51 +00:00
parent 8b0f49b801
commit b252d5f0b9

View File

@ -789,6 +789,9 @@ size_t SegManager::strlen(reg_t str) {
Common::String SegManager::getString(reg_t pointer, int entries) {
Common::String ret;
if (pointer.isNull())
return ret; // empty text
SegmentRef src_r = dereference(pointer);
if (!src_r.isValid()) {
warning("SegManager::getString(): Attempt to dereference invalid pointer %04x:%04x", PRINT_REG(pointer));