Commit graph

2 commits

Author SHA1 Message Date
Claude
8b7488d668 fix: compress.cc stack overflow and unbounded decompression growth
f_compress_file()/f_uncompress_file() strcpy()'d the check_valid_path()
result (no length bound) into a fixed 1024-byte outname[] stack buffer;
an arbitrarily long path overflowed it before any filesystem check ran.
Also fixed f_compress_file()'s !real_output_file branch, which called
FREE_MSTR(output_file) unconditionally even when output_file was the
2-argument form's stack-owned string, not one we allocated.

f_uncompress() accumulated decompressed size into a plain `int len`
across the whole inflate() loop with no bound, only rejecting an
oversized result via allocate_buffer()'s cap *after* fully expanding it
-- letting a small, highly compressible input drive unbounded
intermediate allocation/copy work (and, past ~2GB output, overflow
`len` itself). Now checks `len` against __MAX_BUFFER_SIZE__ every
iteration and bails out immediately.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YTPLudxra3u1andNyWJEQG
2026-07-14 13:37:57 -05:00
Yucong Sun
b327a775dc
Migrate buildsystem to CMake (#431)
fix #361

* basic functional cmake rules
* Adding missing libraies
* Successfully compiled under cmake
* Make sure .sh always has eol=lf
* final cmake related changes
* Getting rid of autoconf automake and jemalloc
* Move testsuite to top directory
* auto config packages using cmake
* Fix file modes
* basic preprocessor
* Adding portbind back
* Fix travis
* Lower libevent requirement to 2.0
* Restore testsuite/log dir
2019-01-07 20:29:34 -08:00