linebender / linebender/resvg

Panic `attempt to multiply with overflow` in `crates/resvg/src/lib.rs`

Open
#937 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
4.1k
Forks
348
Avg merge
1d 14h
Merged PRs (30d)
3

Description

File content(at the bottom should be attached raw, not formatted file - github removes some non-printable characters, so copying from here may not work):
```

```

command
```
timeout -v 100 resvg TEST___FILE.svg
```

cause this
```
thread 'main' panicked at /home/runner/.cargo/git/checkouts/resvg-2970f6cc9c85afc6/ded4b13/crates/resvg/src/lib.rs:44:9:
attempt to multiply with overflow
stack backtrace:
0: __rustc::rust_begin_unwind
at /rustc/e4662966273ed58b51f9ff8d682accc202aa1210/library/std/src/panicking.rs:697:5
1: core::panicking::panic_fmt
at /rustc/e4662966273ed58b51f9ff8d682accc202aa1210/library/core/src/panicking.rs:75:14
2: core::panicking::panic_const::panic_const_mul_overflow
at /rustc/e4662966273ed58b51f9ff8d682accc202aa1210/library/core/src/panicking.rs:175:17
3: resvg::render
at /home/runner/.cargo/git/checkouts/resvg-2970f6cc9c85afc6/ded4b13/crates/resvg/src/lib.rs:44:9
4: resvg::check_file
at ./src/crates/resvg/src/main.rs:40:9
5: resvg::main
at ./src/crates/resvg/src/main.rs:21:9
6: core::ops::function::FnOnce::call_once
at /home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:253:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

##### Automatic Fuzzer note, output status "None", output signal "Some(6)"
```

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in crates/resvg/src/lib.rs at line 44, then reproduce the panic with the SVG content in the issue using `timeout -v 100 resvg TEST___FILE.svg`. Trace the overflow from the render entry point and verify that the supplied malformed SVG completes without a panic.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
computer-graphics
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.