diff options
author | Michael Brown <mcb30@ipxe.org> | 2016-02-11 18:44:24 +0000 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2016-02-11 19:04:23 +0000 |
commit | 12b3b578869d5c25a32edd81950e104a286643d7 (patch) | |
tree | a6c9250db7e8986c130c91a67cab4f3d74258db2 /src/tests/tests.c | |
parent | e2b1140486e6d5da756d64ae5fc051b79664c6d6 (diff) | |
download | ipxe-12b3b578869d5c25a32edd81950e104a286643d7.tar.gz |
[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 54ce86677..2e67043e6 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 ); |