GithubHelp home page GithubHelp logo

Comments (3)

fintelia avatar fintelia commented on September 5, 2024

A test file would be helpful. At very least, it would be good to collect a full backtrace (i.e. run with RUST_BACKTRACE=1). The as_buffer function intentionally doesn't validate its arguments since that is the responsibility of the caller

from image-tiff.

micahsnyder avatar micahsnyder commented on September 5, 2024

@fintelia I received a full backtrace yesterday from the user, but have yet to receive the test file. I will share it if I receive it. Hopefully this helps:

thread '<unnamed>' panicked at 'range start index 16380 out of range for slice of length 9660', /Users/davidlaxer/clamav-0.105.1/libclamav_rust/.cargo/vendor/tiff/src/decoder/mod.rs:131:72
stack backtrace:
   0: rust_begin_unwind
             at /rustc/e1e9319d93aea755c444c8f8ff863b0936d7a4b6/library/std/src/panicking.rs:517:5
   1: core::panicking::panic_fmt
             at /rustc/e1e9319d93aea755c444c8f8ff863b0936d7a4b6/library/core/src/panicking.rs:100:14
   2: core::slice::index::slice_start_index_len_fail
             at /rustc/e1e9319d93aea755c444c8f8ff863b0936d7a4b6/library/core/src/slice/index.rs:34:5
   3: tiff::decoder::DecodingResult::as_buffer
   4: tiff::decoder::Decoder<R>::read_image
             at /Users/davidlaxer/clamav-0.105.1/libclamav_rust/.cargo/vendor/tiff/src/decoder/mod.rs:1230:17
   5: <image::codecs::tiff::TiffDecoder<R> as image::image::ImageDecoder>::read_image
             at /Users/davidlaxer/clamav-0.105.1/libclamav_rust/.cargo/vendor/image/./src/codecs/tiff.rs:222:15
   6: image::image::decoder_to_vec
             at /Users/davidlaxer/clamav-0.105.1/libclamav_rust/.cargo/vendor/image/./src/image.rs:587:5
   7: image::dynimage::decoder_to_image
             at /Users/davidlaxer/clamav-0.105.1/libclamav_rust/.cargo/vendor/image/./src/dynimage.rs:1025:23
   8: image::dynimage::DynamicImage::from_decoder
             at /Users/davidlaxer/clamav-0.105.1/libclamav_rust/.cargo/vendor/image/./src/dynimage.rs:175:9
   9: <image::io::free_functions::load_inner::LoadVisitor as image::io::free_functions::DecoderVisitor>::visit_decoder
             at /Users/davidlaxer/clamav-0.105.1/libclamav_rust/.cargo/vendor/image/./src/io/free_functions.rs:107:13
  10: image::io::free_functions::load_decoder
             at /Users/davidlaxer/clamav-0.105.1/libclamav_rust/.cargo/vendor/image/./src/io/free_functions.rs:64:37
  11: image::io::free_functions::load_inner
             at /Users/davidlaxer/clamav-0.105.1/libclamav_rust/.cargo/vendor/image/./src/io/free_functions.rs:111:5
  12: image::io::free_functions::load
             at /Users/davidlaxer/clamav-0.105.1/libclamav_rust/.cargo/vendor/image/./src/io/free_functions.rs:37:5
  13: image::dynimage::load_from_memory_with_format
             at /Users/davidlaxer/clamav-0.105.1/libclamav_rust/.cargo/vendor/image/./src/dynimage.rs:1221:5
  14: image::dynimage::load_from_memory
             at /Users/davidlaxer/clamav-0.105.1/libclamav_rust/.cargo/vendor/image/./src/dynimage.rs:1206:5
  15: clamav_rust::fuzzy_hash::fuzzy_hash_calculate_image
             at /Users/davidlaxer/clamav-0.105.1/libclamav_rust/src/fuzzy_hash.rs:412:20
  16: fuzzy_hash_calculate_image
             at /Users/davidlaxer/clamav-0.105.1/libclamav_rust/src/fuzzy_hash.rs:213:23
  17: calculate_fuzzy_image_hash
             at /Users/davidlaxer/clamav-0.105.1/libclamav/scanners.c:4088:10
  18: cli_magic_scan
  19: scan_common
             at /Users/davidlaxer/clamav-0.105.1/libclamav/scanners.c:5419:14
  20: cl_scandesc_callback
             at /Users/davidlaxer/clamav-0.105.1/libclamav/scanners.c:5595:14
  21: scanfile
             at /Users/davidlaxer/clamav-0.105.1/clamscan/manager.c:411:16
  22: scandirs
  23: scandirs
  24: scandirs
  25: scandirs
  26: scandirs
  27: scandirs
  28: scandirs
  29: scandirs
  30: scandirs
  31: scandirs
  32: scandirs
  33: scandirs
  34: scan_files
  35: scanmanager
             at /Users/davidlaxer/clamav-0.105.1/clamscan/manager.c:1625:15
  36: main
             at /Users/davidlaxer/clamav-0.105.1/clamscan/clamscan.c:171:11
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
fatal runtime error: failed to initiate panic, error 5
zsh: abort      RUST_BACKTRACE=1 clamscan -r -i --bell --exclude-dir=/Users/davidlaxer/clamav
(ai) davidlaxer@x86_64-apple-darwin13 build % 

from image-tiff.

micahsnyder avatar micahsnyder commented on September 5, 2024

@fintelia here is the sample file. I'll play with it a little as well to see if I can find a solution, but you're not doubt better equipped to solve it.

tiff-issue-171.zip

from image-tiff.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.