Home
last modified time | relevance | path

Searched hist:"07 febdbb" (Results 1 – 2 of 2) sorted by relevance

/openbmc/libpldm/tests/
H A Dmsgbuf.cpp07febdbb Thu May 16 23:47:14 CDT 2024 Andrew Jeffery <andrew@codeconstruct.com.au> msgbuf: Rework detection of invalid memory regions

From Annex J.2 of N2176 (C17 draft specification):

> Addition or subtraction of a pointer into, or just beyond, an array
> object and an integer type produces a result that does not point into,
> or just beyond, the same array object (6.5.6).

Instead we can lean on uintptr_t from 7.20.1.4, and from there the
defined behavior of unsigned overflow.

Change-Id: Ia1b47b87efeb9c96057d294a3e38e90bfdba5386
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
/openbmc/libpldm/src/
H A Dmsgbuf.h07febdbb Thu May 16 23:47:14 CDT 2024 Andrew Jeffery <andrew@codeconstruct.com.au> msgbuf: Rework detection of invalid memory regions

From Annex J.2 of N2176 (C17 draft specification):

> Addition or subtraction of a pointer into, or just beyond, an array
> object and an integer type produces a result that does not point into,
> or just beyond, the same array object (6.5.6).

Instead we can lean on uintptr_t from 7.20.1.4, and from there the
defined behavior of unsigned overflow.

Change-Id: Ia1b47b87efeb9c96057d294a3e38e90bfdba5386
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>