planetarium/rocksdb-sharp

RocksDb.ctor() occurs if path parameter is null

オープン

#3 opened on 2021/01/27

 (0 件のコメント) (0 件のリアクション) (0 人の担当者)C# (3 件のフォーク)auto 404
buggood first issue

Repository metrics

Stars
 (4 個のスター)
PR merge metrics
 (PR metrics pending)

説明

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

コントリビューターガイド