[PATCH] D55811: [compiler-rt] [sanitizer_common] Fix sha2 interceptors not to use vars in array len

Michał Górny via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 19 09:25:40 PST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL349645: [sanitizer_common] Fix sha2 interceptors not to use vars in array len (authored by mgorny, committed by ).
Herald added a subscriber: delcypher.

Changed prior to commit:
  https://reviews.llvm.org/D55811?vs=178608&id=178897#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55811/new/

https://reviews.llvm.org/D55811

Files:
  compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc


Index: compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc
===================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc
@@ -8511,9 +8511,10 @@
     if (context) \
       COMMON_INTERCEPTOR_WRITE_RANGE(ctx, context, SHA##LEN##_CTX_sz); \
   } \
-  INTERCEPTOR(void, SHA##LEN##_Final, u8 digest[SHA##LEN##_digest_length], \
+  INTERCEPTOR(void, SHA##LEN##_Final, u8 digest[LEN/8], \
   void *context) { \
     void *ctx; \
+    CHECK_EQ(SHA##LEN##_digest_length, LEN/8); \
     COMMON_INTERCEPTOR_ENTER(ctx, SHA##LEN##_Final, digest, context); \
     if (context) \
       COMMON_INTERCEPTOR_READ_RANGE(ctx, context, SHA##LEN##_CTX_sz); \


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55811.178897.patch
Type: text/x-patch
Size: 819 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181219/f3ec8bea/attachment.bin>


More information about the cfe-commits mailing list