[compiler-rt] r329842 - [sanitizer] Correct name length computation for some Fuchsia vmos

Kostya Kortchinsky via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 11 11:55:26 PDT 2018


Author: cryptoad
Date: Wed Apr 11 11:55:26 2018
New Revision: 329842

URL: http://llvm.org/viewvc/llvm-project?rev=329842&view=rev
Log:
[sanitizer] Correct name length computation for some Fuchsia vmos

Summary:
This was missed during the review of D38595, but the vmo name size computation
should use internal_strlen, not sizeof, otherwise we end up with 7 character
names.

Reviewers: mcgrathr, flowerhack

Reviewed By: mcgrathr

Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits

Differential Revision: https://reviews.llvm.org/D45525

Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_fuchsia.cc

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_fuchsia.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_fuchsia.cc?rev=329842&r1=329841&r2=329842&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_fuchsia.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_fuchsia.cc Wed Apr 11 11:55:26 2018
@@ -272,7 +272,7 @@ static uptr DoMmapFixedOrDie(zx_handle_t
       ReportMmapFailureAndDie(map_size, name, "zx_vmo_create", status);
     return 0;
   }
-  _zx_object_set_property(vmo, ZX_PROP_NAME, name, sizeof(name) - 1);
+  _zx_object_set_property(vmo, ZX_PROP_NAME, name, internal_strlen(name));
   DCHECK_GE(base + size_, map_size + offset);
   uintptr_t addr;
 




More information about the llvm-commits mailing list