From fed65e6a48c5bed938c9bafb40409cd7e398f1c9 Mon Sep 17 00:00:00 2001 From: xtkoba <69125751+xtkoba@users.noreply.github.com> Date: Wed, 13 Oct 2021 08:40:48 -0700 Subject: [ruby/digest] Avoid null pointer subtraction in digest/md5 Fixes warning on Clang 13. Fixes [Bug #18076] https://github.com/ruby/digest/commit/32135c7487 --- ext/digest/md5/md5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/digest') 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 { -- cgit v1.2.3