diff options
author | Michael Brown | 2016-02-11 19:44:24 +0100 |
---|---|---|
committer | Michael Brown | 2016-02-11 20:04:23 +0100 |
commit | 12b3b578869d5c25a32edd81950e104a286643d7 (patch) | |
tree | a6c9250db7e8986c130c91a67cab4f3d74258db2 /src/tests/tests.c | |
parent | [malloc] Guard against unsigned integer overflow (diff) | |
download | ipxe-12b3b578869d5c25a32edd81950e104a286643d7.tar.gz ipxe-12b3b578869d5c25a32edd81950e104a286643d7.tar.xz ipxe-12b3b578869d5c25a32edd81950e104a286643d7.zip |
[iobuf] Improve robustness of I/O buffer allocation
Guard against various corner cases (such as zero-length buffers, zero
alignments, and integer overflow when rounding up allocation lengths
and alignments) and ensure that the struct io_buffer is correctly
aligned even when the caller requests a non-zero alignment for the I/O
buffer itself.
Add self-tests to verify that the resulting alignments and lengths are
correct for a range of allocations.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/tests/tests.c')
-rw-r--r-- | src/tests/tests.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/tests/tests.c b/src/tests/tests.c index 54ce8667..2e67043e 100644 --- a/src/tests/tests.c +++ b/src/tests/tests.c @@ -67,3 +67,4 @@ REQUIRE_OBJECT ( profile_test ); REQUIRE_OBJECT ( setjmp_test ); REQUIRE_OBJECT ( pccrc_test ); REQUIRE_OBJECT ( linebuf_test ); +REQUIRE_OBJECT ( iobuf_test ); |