mem: fix bug with CopyStringOut and null string termination.
authorAli Saidi <Ali.Saidi@ARM.com>
Thu, 10 May 2012 23:04:27 +0000 (18:04 -0500)
committerAli Saidi <Ali.Saidi@ARM.com>
Thu, 10 May 2012 23:04:27 +0000 (18:04 -0500)
src/mem/fs_translating_port_proxy.cc

index bf0c076c6d94f9260404d4bb2e3358762b536b98..9f1f7d019d5cad5ffa072d2afbb859ac5ba97231 100644 (file)
@@ -140,7 +140,7 @@ CopyStringOut(ThreadContext *tc, char *dst, Addr vaddr, size_t maxlen)
     bool foundNull = false;
     while ((dst - start + 1) < maxlen && !foundNull) {
         vp.readBlob(vaddr++, (uint8_t*)dst, 1);
-        if (dst == '\0')
+        if (*dst == '\0')
             foundNull = true;
         dst++;
     }