Skip to content
Snippets Groups Projects
Commit 32dfcb3c authored by Ilya Verbin's avatar Ilya Verbin Committed by Vladimir Davydov
Browse files

box: check return value of obuf_alloc() in xlog_tx_write_zstd()

obuf_alloc(&log->zbuf, XLOG_FIXHEADER_SIZE) can potentially fail,
because there is no obuf_reserve() prior to it.

Closes tarantool/security#74

NO_DOC=bugfix
NO_CHANGELOG=bugfix
NO_TEST=no test harness for checking OOM
parent 3abfe472
No related branches found
No related tags found
No related merge requests found
......@@ -1151,7 +1151,11 @@ xlog_tx_write_zstd(struct xlog *log)
{
char *fixheader = (char *)obuf_alloc(&log->zbuf,
XLOG_FIXHEADER_SIZE);
if (fixheader == NULL) {
diag_set(OutOfMemory, XLOG_FIXHEADER_SIZE, "runtime arena",
"compression buffer");
goto error;
}
uint32_t crc32c = 0;
struct iovec *iov;
/* 3 is compression level. */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment