summaryrefslogtreecommitdiff
path: root/ext/digest
diff options
context:
space:
mode:
authorxtkoba <69125751+xtkoba@users.noreply.github.com>2021-10-13 08:40:48 -0700
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2021-11-16 18:35:07 +0900
commitfed65e6a48c5bed938c9bafb40409cd7e398f1c9 (patch)
treea5c28c378b827ecc595463e23c404a2b3f47a5b7 /ext/digest
parent7a816b5fc81cf70c92796c2b1794d32887d8e777 (diff)
[ruby/digest] Avoid null pointer subtraction in digest/md5
Fixes warning on Clang 13. Fixes [Bug #18076] https://github.com/ruby/digest/commit/32135c7487
Diffstat (limited to 'ext/digest')
-rw-r--r--ext/digest/md5/md5.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/digest/md5/md5.c b/ext/digest/md5/md5.c
index 19fe54a693..3a7fe2cdad 100644
--- a/ext/digest/md5/md5.c
+++ b/ext/digest/md5/md5.c
@@ -225,7 +225,7 @@ md5_process(MD5_CTX *pms, const uint8_t *data /*[64]*/)
uint32_t xbuf[16];
const uint32_t *X;
- if (!((data - (const uint8_t *)0) & 3)) {
+ if (!(((uintptr_t)data) & 3)) {
/* data are properly aligned */
X = (const uint32_t *)data;
} else {