JuliaIO / HDF5.jl

Save and load data in the HDF5 file format from Julia
https://juliaio.github.io/HDF5.jl
MIT License
380 stars 138 forks source link

Guard malloc in compression filters #1152

Open mkitti opened 1 month ago

mkitti commented 1 month ago

Providing a length of 0 bytes to malloc could result in a valid pointer being generated. This is probably an error.

This pull request detects this condition and errors if detected. Also improves error messaging for failed allocation.

mkitti commented 1 month ago

Thanks for the fix. Also, should there be a way to just accept the formatter suggestions?

musm commented 1 month ago

Do you mean to use https://github.com/julia-actions/julia-format

name: Format suggestions
on:
  pull_request:
    # this argument is not required if you don't use the `suggestion-label` input
    types: [ opened, reopened, synchronize, labeled, unlabeled ]
jobs:
  code-style:
    runs-on: ubuntu-latest
    steps:
      - uses: julia-actions/julia-format@v3
        with:
          version: '1' # Set `version` to '1.0.54' if you need to use JuliaFormatter.jl v1.0.54 (default: '1')
          suggestion-label: 'format-suggest' # leave this unset or empty to show suggestions for all PRs
mkitti commented 1 month ago

Trying julia-format in #1153 , might merge that into a copy of this branch to see how it behaves.