Skip to content
This repository has been archived by the owner on Aug 17, 2024. It is now read-only.

Commit

Permalink
Merge branch 'master' into fix-newlines
Browse files Browse the repository at this point in the history
  • Loading branch information
westy92 committed Dec 3, 2023
2 parents 1b97006 + 38ec4ae commit 6329a9d
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 10 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/CICD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,24 @@ jobs:
command: test
args: --all-features

fuzz:
name: Test Suite
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install cargo-fuzz
uses: taiki-e/install-action@v2
with:
tool: cargo-fuzz

- name: Nightly
run: rustup default nightly

- name: Run Fuzzer
run: cargo +nightly fuzz run ical -- -max_total_time=10

lints:
name: Lints
runs-on: ubuntu-latest
Expand Down
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ license-file = "./LICENSE"
name = "ical"
readme = "./README.md"
repository = "https://github.com/Peltoche/ical-rs"
version = "0.7.0"
version = "0.9.0"

[badges]

Expand All @@ -18,8 +18,8 @@ branch = "master"
repository = "https://travis-ci.org/Peltoche/ical-rs"

[dependencies]
thiserror = "1.0.38"
serde = { version = "1.0.152", features = ["derive"], optional = true }
thiserror = "1.0.50"
serde = { version = "1.0.193", features = ["derive"], optional = true }

[features]
default = ["vcard", "ical"]
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Put this in your `Cargo.toml`:

```toml
[dependencies]
ical = "0.7.*"
ical = "0.9"
```


Expand Down Expand Up @@ -49,7 +49,7 @@ Each component can contains properties (ie: `Property`) or sub-components.
Cargo.toml:
```toml
[dependencies.ical]
version = "0.7.*"
version = "0.9"
default-features = false
features = ["ical", "vcard"]
```
Expand Down Expand Up @@ -112,7 +112,7 @@ It work for both the vCard and iCal formats.
Cargo.toml:
```toml
[dependencies.ical]
version = "0.7.*"
version = "0.9"
default-features = false
features = ["property"]
```
Expand Down Expand Up @@ -155,7 +155,7 @@ It work for both the vCard and iCal formats.
Cargo.toml:
```toml
[dependencies.ical]
version = "0.7.*"
version = "0.9"
default-features = false
features = ["line"]
```
Expand Down Expand Up @@ -202,7 +202,7 @@ formalities.
Cargo.toml:
```toml
[dependencies.ical]
version = "0.7.*"
version = "0.9"
default-features = false
features = ["ical", "vcard", "generator"]
```
Expand Down
4 changes: 4 additions & 0 deletions fuzz/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
target
corpus
artifacts
coverage
26 changes: 26 additions & 0 deletions fuzz/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[package]
name = "ical-fuzz"
version = "0.0.0"
publish = false

[package.metadata]
cargo-fuzz = true

[dependencies]
libfuzzer-sys = "0.4"

[dependencies.ical]
path = ".."

# Prevent this from interfering with workspaces
[workspace]
members = ["."]

[profile.release]
debug = 1

[[bin]]
name = "ical"
path = "fuzz_targets/ical.rs"
test = false
doc = false
12 changes: 12 additions & 0 deletions fuzz/fuzz_targets/ical.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#![no_main]

extern crate libfuzzer_sys;
extern crate ical;


use libfuzzer_sys::fuzz_target;

fuzz_target!(|data: &[u8]| {
let c = std::io::Cursor::new(data);
for _ in ical::IcalParser::new(c) {}
});
4 changes: 2 additions & 2 deletions src/line.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ impl<B: BufRead> LineRead for LineReader<B> {
} else {
// This is the first iteration, next_start isn't been filled yet.
for line in self.reader.by_ref().lines() {
let line = line.unwrap();
let line = line.ok()?;
self.number += 1;

if !line.is_empty() {
Expand All @@ -130,7 +130,7 @@ impl<B: BufRead> LineRead for LineReader<B> {
}

for line in self.reader.by_ref().lines() {
let mut line = line.unwrap();
let mut line = line.ok()?;

if line.is_empty() {
self.number += 1;
Expand Down

0 comments on commit 6329a9d

Please sign in to comment.