1
0
mirror of https://github.com/bitdefender/bddisasm.git synced 2024-12-22 14:08:08 +00:00

Fixed potential unaligned load, as reported by UBSAN.

This commit is contained in:
Andrei Vlad LUTAS 2024-05-28 19:20:38 +03:00
parent 63ca9e4328
commit 91f04ed43b
4 changed files with 13 additions and 13 deletions

View File

@ -5,6 +5,12 @@ All notable (user-facing) changes to this project will be documented in this fil
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [2.1.5] - 2024-05-28
### Fixed
- Potential unaligned load, as reported by UBSAN.
## [2.1.4] - 2024-03-27
### Changed

View File

@ -12,7 +12,7 @@ from setuptools import find_packages, setup, Command, Extension, Distribution
from codecs import open
VERSION = (0, 3, 0)
LIBRARY_VERSION = (2, 1, 4)
LIBRARY_VERSION = (2, 1, 5)
DIR_INCLUDE = '../../inc'
here = os.path.abspath(os.path.dirname(__file__))

View File

@ -7,7 +7,7 @@
#define DISASM_VERSION_MAJOR 2
#define DISASM_VERSION_MINOR 1
#define DISASM_VERSION_REVISION 4
#define DISASM_VERSION_REVISION 5
#define SHEMU_VERSION_MAJOR DISASM_VERSION_MAJOR
#define SHEMU_VERSION_MINOR DISASM_VERSION_MINOR

View File

@ -373,17 +373,11 @@ typedef ND_UINT32 ND_REG_SIZE;
// Sets the sign of the sz bytes long value x.
#define ND_SET_SIGN(sz, x) ND_SIGN_EX(sz, x)
#ifdef BIG_ENDIAN
#define ND_FETCH_64(b) ((ND_UINT64)ND_FETCH_32((char *)b) | ((ND_UINT64)ND_FETCH_32((char *)b + 4) << 32))
#define ND_FETCH_32(b) ((ND_UINT32)ND_FETCH_16((char *)b) | ((ND_UINT32)ND_FETCH_16((char *)b + 2) << 16))
#define ND_FETCH_16(b) ((((char *)b)[0]) | (((char *)b)[1] << 8))
#define ND_FETCH_8(b) (*((char *)b))
#else
#define ND_FETCH_64(b) (*((ND_UINT64 *)(b)))
#define ND_FETCH_32(b) (*((ND_UINT32 *)(b)))
#define ND_FETCH_16(b) (*((ND_UINT16 *)(b)))
#define ND_FETCH_8(b) (*((ND_UINT8 *)(b)))
#endif
#define ND_FETCH_64(b) (((ND_UINT64)ND_FETCH_32((ND_UINT8 *)b)) | (((ND_UINT64)ND_FETCH_32((ND_UINT8 *)b + 4) << 32)))
#define ND_FETCH_32(b) (((ND_UINT32)ND_FETCH_16((ND_UINT8 *)b)) | (((ND_UINT32)ND_FETCH_16((ND_UINT8 *)b + 2) << 16)))
#define ND_FETCH_16(b) (((ND_UINT16)ND_FETCH_8 ((ND_UINT8 *)b)) | (((ND_UINT16)ND_FETCH_8 ((ND_UINT8 *)b + 1) << 8)))
#define ND_FETCH_8(b) (*((ND_UINT8 *)b))
//