Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak on decoding a malformed image #34

Closed
Shnatsel opened this issue Aug 30, 2018 · 2 comments
Closed

Memory leak on decoding a malformed image #34

Shnatsel opened this issue Aug 30, 2018 · 2 comments

Comments

@Shnatsel
Copy link
Contributor

lodepng-rust leaks memory when given malicious input. This issue has been discovered via fuzzing with afl and libdiffuzz, later confirmed with address sanitizer.

Steps to reproduce:

  1. Download and unpack lodepng-repr-diff.tar.gz - this is a Rust project with Cargo
  2. cd lodepng-repr-diff
  3. cargo build --release
  4. run target/release/target/release/lodepng-afl-fuzz-differential < memory_leaking_files/id:000000,sig:06,src:000389,op:havoc,rep:2 and observe memory consumption of the process steadily increase. This should be the case for any file from memory_leaking_files/

This issue has been discovered in version 2.3.0, so it is distinct from #28

@kornelski
Copy link
Owner

kornelski commented Aug 30, 2018

I've tried these files with valgrind --leak-check=full and it didn't find any problems in 9a72cc4.

I believe that is the same issue as #28, fixed in 37a7bcc. That commit wasn't part of 2.3.0. I've corrected that by releasing 2.4.0.

Thank you for fuzzing the codebase. I appreciate it. 2.4.0 has migrated from a custom vector type to Vec, so it could have new bugs :)

@Shnatsel
Copy link
Contributor Author

Closing as duplicate of #28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants