planetarium/rocksdb-sharp

RocksDb.ctor() occurs if path parameter is null

Offen

#3 geöffnet am 27.01.2021

 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)C# (3 Forks)auto 404
buggood first issue

Repository-Metriken

Stars
 (4 Sterne)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

When calling RocksDb's constructor with with null path parameter, it occurs System.AccessViolationException.

Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at RocksDbSharp.Native.rocksdb_open(IntPtr, System.String)
   at RocksDbSharp.RocksDb.Open(RocksDbSharp.OptionsHandle, System.String)
   at RocksDBTool.Program+<Main>d__0.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.__Canon, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.__Canon ByRef)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.__Canon, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.__Canon ByRef)
   at RocksDBTool.Program.Main(System.String[])
   at RocksDBTool.Program.<Main>(System.String[])

It should check it is null and throw System.ArgumentNullException. https://github.com/planetarium/rocksdb-sharp/blob/ccaf2184464963b565f7cfb9627cdf4734434af6/RocksDbSharp/RocksDb.cs#L42-L46

Contributor Guide