summaryrefslogtreecommitdiff
path: root/ext/mysqlnd/mysqlnd_portability.h
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2020-01-28 09:15:23 +0100
committerChristoph M. Becker <cmbecker69@gmx.de>2020-01-28 09:18:05 +0100
commit412b476b7fb386c6aa04efb936881f5b2250ded9 (patch)
tree0ddfec45e89e1c9e2ba700e4b4d4c0d6d72916d2 /ext/mysqlnd/mysqlnd_portability.h
parent5215f072af4bd8993488780df45639f12757124d (diff)
downloadphp-git-412b476b7fb386c6aa04efb936881f5b2250ded9.tar.gz
Fix #79172: STRUCT_OFFSET() relies on undefined behavior
Since this pattern is understood by compilers, not a real issue, but certainly cleaner this way.
Diffstat (limited to 'ext/mysqlnd/mysqlnd_portability.h')
-rw-r--r--ext/mysqlnd/mysqlnd_portability.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/mysqlnd/mysqlnd_portability.h b/ext/mysqlnd/mysqlnd_portability.h
index 873f49b0cd..2064906193 100644
--- a/ext/mysqlnd/mysqlnd_portability.h
+++ b/ext/mysqlnd/mysqlnd_portability.h
@@ -15,7 +15,7 @@ This file is public domain and comes with NO WARRANTY of any kind */
/* Comes from global.h as OFFSET, renamed to STRUCT_OFFSET */
-#define STRUCT_OFFSET(t, f) ((size_t)(char *)&((t *)0)->f)
+#define STRUCT_OFFSET(t, f) XtOffsetOf(t, f)
#ifndef __attribute
#if !defined(__GNUC__)