[PATCH] D45525: [sanitizer] Correct name length computation for some Fuchsia vmos

Kostya Kortchinsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 11 09:28:40 PDT 2018


cryptoad created this revision.
cryptoad added reviewers: mcgrathr, flowerhack.
Herald added subscribers: Sanitizers, delcypher, kubamracek.

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


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D45525

Files:
  lib/sanitizer_common/sanitizer_fuchsia.cc


Index: lib/sanitizer_common/sanitizer_fuchsia.cc
===================================================================
--- lib/sanitizer_common/sanitizer_fuchsia.cc
+++ lib/sanitizer_common/sanitizer_fuchsia.cc
@@ -272,7 +272,7 @@
       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;
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45525.142029.patch
Type: text/x-patch
Size: 537 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180411/2c9dfbf6/attachment.bin>


More information about the llvm-commits mailing list