← Commit list

cfcd2399b

Denys Vlasenko
Denys Vlasenko
2014-12-07
SUCCESS Duration: 174s

Subject

make xmalloc_open_zipped_read_close result NUL terminated

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

archival/libarchive/open_transformer.c+2 -1
@@ -43,8 +43,9 @@ ssize_t FAST_FUNC transformer_write(transformer_state_t *xstate, const void *buf
nwrote = -1;
goto ret;
}
- xstate->mem_output_buf = xrealloc(xstate->mem_output_buf, size);
+ xstate->mem_output_buf = xrealloc(xstate->mem_output_buf, size + 1);
memcpy(xstate->mem_output_buf + pos, buf, bufsize);
+ xstate->mem_output_buf[size] = '\0';
nwrote = bufsize;
} else {
nwrote = full_write(xstate->dst_fd, buf, bufsize);