Skip to content

Commit

Permalink
docproc: guard against overflow
Browse files Browse the repository at this point in the history
Signed-off-by: Zoltan Fridrich <zfridric@redhat.com>
  • Loading branch information
ZoltanFridrich committed May 10, 2024
1 parent 805d2dd commit 56e4e01
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/doc/bin/docproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,8 @@ static void find_all_symbols(char *filename)
do {
while ((ret = read(pipefd[0],
data + data_len,
4096)) > 0) {
4096)) > 0 &&
data_len <= SIZE_MAX - 4096 - ret) {
data_len += (size_t)ret;
data = realloc(data, data_len + 4096);
if (!data) {
Expand Down

0 comments on commit 56e4e01

Please sign in to comment.