boostorg / boostorg/build

Potential memory leak in file_collect_archive_content_

Open
#325 1 comment 0 reactions 0 assignees View on GitHub
transition
Dominant language
C++
Stars
251
Forks
63
PR merge metrics
No merged PRs in 30d

Description

https://github.com/boostorg/build/blob/0c6d016/src/engine/fileunix.c#L324 performs a memory allocation which has a chance of leaking when processing a corrupt archive.

In the unlikely situation where an archive has two string tables (or simply one string table and another entry with a name that starts with `//`) there will be a second allocation and the original value of `string_table` will be leaked.

This probably isn't worth fixing, I'm only reporting it because Coverity flags it as a leak. If you do want to make any change then it's probably enough to just do something like:

assert(!string_table);

before the allocation.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.