tests: add blob-buffer overflow test
authorZefir Kurtisi <zefir.kurtisi@gmail.com>
Fri, 23 Apr 2021 17:48:00 +0000 (19:48 +0200)
committerPetr Štetiar <ynezz@true.cz>
Thu, 29 Apr 2021 13:34:21 +0000 (15:34 +0200)
commita0dbcf8b8f966ce8a358afe555bb75401ef1e9be
tree9b680f476497adff7c7e41faf85fb9155ae73aac
parent551d75b5662cccd0466b990d58136bdf799a804d
tests: add blob-buffer overflow test

The blob buffer has no limitation in place
to prevent buflen to exceed maximum size.

This commit adds a test to demonstrate how
a blob increases past the maximum allowd
size of 16MB. It continuously adds chunks
of 64KB and with the 255th one blob_add()
returns a valid attribute pointer but the
blob's buflen does not increase.

The test is used to demonstrate the
failure, which is fixed with a follow-up
commit.

Signed-off-by: Zefir Kurtisi <zefir.kurtisi@gmail.com>
[adjusted test case for cram usage]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
tests/cram/test_blob_buflen.t [new file with mode: 0644]
tests/test-blob-buflen.c [new file with mode: 0644]