php-src/ext/pdo_firebird
Niels Dossche 21e0305f5d Fix GH-10908: Bus error with PDO Firebird on RPI with 64 bit kernel and 32 bit userland
The alignment of sqldata is in most cases only the basic alignment,
so the code type-puns it to a larger type, it *can* crash due to the
misaligned access. This is only an issue for types > 4 bytes because
every sensible system requires an alignment of at least 4 bytes for
allocated data.

Even though this patch uses memcpy, the compiler is smart enough to
optimise it to something more efficient, especially on x86.
This is just the usual approach to solve these alignment problems.

Actually, unaligned memory access is undefined behaviour, so even on x86
platforms, where the bug doesn't cause a crash, this can be problematic.
Furthermore, even though the issue talks about a 64-bit kernel and
32-bit userspace, this doesn't necessarily need to be the case to
trigger this crash.

Test was Co-authored-by: rvk01

Closes GH-10920.
2023-03-27 21:01:06 +02:00
..
tests Fix GH-10908: Bus error with PDO Firebird on RPI with 64 bit kernel and 32 bit userland 2023-03-27 21:01:06 +02:00
config.m4 Add AS_HELP_STRING to *nix build configure options 2019-03-07 20:36:59 +01:00
config.w32 Trim trailing whitespace in source code files 2018-10-13 14:17:28 +02:00
CREDITS
firebird_driver.c Merge branch 'PHP-8.0' 2021-06-27 21:40:02 -07:00
firebird_statement.c Fix GH-10908: Bus error with PDO Firebird on RPI with 64 bit kernel and 32 bit userland 2023-03-27 21:01:06 +02:00
pdo_firebird.c Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
php_pdo_firebird.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
php_pdo_firebird_int.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00