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

Change tar detection to use checksum instead of legal ranges of values #466

Merged
merged 1 commit into from
Jan 3, 2024

Conversation

gabriel-vasile
Copy link
Owner

Previous detection used the rules from PRONOM.
This commit replaces those rules with the check from github.com/file/file: compute checksum for header and check if recorded checksum matches.
Fixes #464

Previous detection used the rules from PRONOM. This commit replaces
those rules with the check from github.com/file/file: compute checksum
for header and check if recorded checksum matches.
Fixes #464
}
return int64(x), nil

Check failure

Code scanning / CodeQL

Incorrect conversion between integer types

Incorrect conversion of an unsigned 64-bit integer from [strconv.ParseUint](1) to a lower bit size type int64 without an upper bound check.
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (02af149) 94.96% compared to head (a10ec04) 94.96%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #466   +/-   ##
=======================================
  Coverage   94.96%   94.96%           
=======================================
  Files           3        3           
  Lines         159      159           
=======================================
  Hits          151      151           
  Misses          6        6           
  Partials        2        2           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gabriel-vasile gabriel-vasile merged commit 4ea95cd into master Jan 3, 2024
@gabriel-vasile gabriel-vasile deleted the tar branch January 3, 2024 14:05
pellared referenced this pull request in open-telemetry/opentelemetry-go-contrib May 24, 2024
….4 (#5660)

[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[github.com/gabriel-vasile/mimetype](https://github.com/gabriel-vasile/mimetype)
| `v1.4.3` -> `v1.4.4` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fgabriel-vasile%2fmimetype/v1.4.4?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2fgabriel-vasile%2fmimetype/v1.4.4?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2fgabriel-vasile%2fmimetype/v1.4.3/v1.4.4?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fgabriel-vasile%2fmimetype/v1.4.3/v1.4.4?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>gabriel-vasile/mimetype
(github.com/gabriel-vasile/mimetype)</summary>

###
[`v1.4.4`](https://github.com/gabriel-vasile/mimetype/releases/tag/v1.4.4)

[Compare
Source](https://github.com/gabriel-vasile/mimetype/compare/v1.4.3...v1.4.4)

#### What's Changed

##### Security fixes:

Update `golang.org/x/net` to latest. Fixes:
[CVE-2023-45288](https://deps.dev/advisory/osv/GO-2024-2687)

##### Performance improvements:

- Change tar detection to use checksum instead of legal ranges of values
in
[https://github.com/gabriel-vasile/mimetype/pull/466](https://github.com/gabriel-vasile/mimetype/pull/466)
- ftyp: exit asap to prevent mem allocs in
[https://github.com/gabriel-vasile/mimetype/pull/517](https://github.com/gabriel-vasile/mimetype/pull/517)
- Improve x-subrip detection performance in
[https://github.com/gabriel-vasile/mimetype/pull/524](https://github.com/gabriel-vasile/mimetype/pull/524)
- improve performance for text detection in
[https://github.com/gabriel-vasile/mimetype/pull/532](https://github.com/gabriel-vasile/mimetype/pull/532)
- Using io.ReadAll instead of ioutil.ReadAll by
[@&#8203;phihungtf](https://github.com/phihungtf) in
[https://github.com/gabriel-vasile/mimetype/pull/525](https://github.com/gabriel-vasile/mimetype/pull/525)

Benchmarks:

```bash
before:
BenchmarkText/application/x-ndjson-8              663314              2027 ns/op            4306 B/op          6 allocs/op
BenchmarkSliceRand-8                              688160              1690 ns/op             728 B/op         75 allocs/op
BenchmarkSrt-8                                    946042              1089 ns/op            4240 B/op          5 allocs/op
after:
BenchmarkText/application/x-ndjson-8             1930292               678.6 ns/op           160 B/op          4 allocs/op
BenchmarkSliceRand-8                             1232066              1173 ns/op             160 B/op          4 allocs/op
BenchmarkSrt-8                                   3235448               368.8 ns/op            64 B/op          2 allocs/op
```

#### New Contributors

- [@&#8203;phihungtf](https://github.com/phihungtf) made their first
contribution in
[https://github.com/gabriel-vasile/mimetype/pull/525](https://github.com/gabriel-vasile/mimetype/pull/525)

**Full Changelog**:
gabriel-vasile/mimetype@v1.4.3...v1.4.4

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/open-telemetry/opentelemetry-go-contrib).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zNjguMTAiLCJ1cGRhdGVkSW5WZXIiOiIzNy4zNjguMTAiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbIlNraXAgQ2hhbmdlbG9nIiwiZGVwZW5kZW5jaWVzIl19-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

Tar format not detected.
2 participants