diff --git a/lib/doc/bin/docproc.c b/lib/doc/bin/docproc.c index 74b3cdb..0719cdd 100644 --- a/lib/doc/bin/docproc.c +++ b/lib/doc/bin/docproc.c @@ -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) {