-
-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feature/jsr-310-localdate
# Conflicts: # src/main/java/net/fortuna/ical4j/model/property/Geo.java # src/test/java/net/fortuna/ical4j/data/CalendarParserImplTest.java
- Loading branch information
Showing
8 changed files
with
143 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: CIFuzz | ||
on: [pull_request] | ||
jobs: | ||
Fuzzing: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Build Fuzzers | ||
id: build | ||
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master | ||
with: | ||
oss-fuzz-project-name: 'ical4j' | ||
dry-run: false | ||
- name: Run Fuzzers | ||
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master | ||
with: | ||
oss-fuzz-project-name: 'ical4j' | ||
fuzz-seconds: 600 | ||
dry-run: false | ||
- name: Upload Crash | ||
uses: actions/upload-artifact@v1 | ||
if: failure() && steps.build.outcome == 'success' | ||
with: | ||
name: artifacts | ||
path: ./out/artifacts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
src/test/groovy/net/fortuna/ical4j/model/property/GeoSpec.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* | ||
* Copyright (c) 2022, Ben Fortuna | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: | ||
* | ||
* o Redistributions of source code must retain the above copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* | ||
* o Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in the | ||
* documentation and/or other materials provided with the distribution. | ||
* | ||
* o Neither the name of Ben Fortuna nor the names of any other contributors | ||
* may be used to endorse or promote products derived from this software | ||
* without specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR | ||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | ||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | ||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | ||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
* | ||
*/ | ||
|
||
package net.fortuna.ical4j.model.property | ||
|
||
import net.fortuna.ical4j.model.ParameterList | ||
import net.fortuna.ical4j.util.CompatibilityHints | ||
import spock.lang.Specification | ||
|
||
class GeoSpec extends Specification { | ||
|
||
def cleanup() { | ||
CompatibilityHints.clearHintEnabled(CompatibilityHints.KEY_RELAXED_PARSING) | ||
} | ||
|
||
def 'test invalid parsing'() { | ||
when: 'a non-conforming GEO string is parsed' | ||
def geo = new Geo.Factory().createProperty([] as ParameterList, '123.456\\;-987.654') | ||
|
||
then: 'an exception is thrown' | ||
thrown(IllegalArgumentException) | ||
} | ||
|
||
def 'test relaxed parsing'() { | ||
setup: 'enable relaxed parsing' | ||
CompatibilityHints.setHintEnabled(CompatibilityHints.KEY_RELAXED_PARSING, true) | ||
|
||
when: 'a non-conforming GEO string is parsed' | ||
def geo = new Geo.Factory().createProperty([] as ParameterList, '123.456\\;-987.654') | ||
|
||
then: 'the expected instance is created' | ||
geo.value == '123.456;-987.654' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/test/resources/samples/invalid/sogo-geo-escaped-semicolon.ics
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
BEGIN:VCALENDAR | ||
PRODID:-//Inverse inc./SOGo 3.2.10//EN | ||
VERSION:2.0 | ||
BEGIN:VEVENT | ||
DESCRIPTION:Some description | ||
DTEND:20221012T183000Z | ||
DTSTAMP:20220805T143350Z | ||
DTSTART:20221012T170000Z | ||
GEO:12.34567\;12.34567 | ||
LOCATION:Some place | ||
SEQUENCE:0 | ||
SUMMARY:Summary | ||
TRANSP:OPAQUE | ||
UID:A-Unique-ID | ||
END:VEVENT | ||
END:VCALENDAR |