planetarium/rocksdb-sharp

RocksDb.ctor() occurs if path parameter is null

開放

#3 建立於 2021年1月27日

 (0 則留言) (0 個反應) (0 位負責人)C# (3 個分叉)auto 404
buggood first issue

倉庫指標

星標
 (4 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

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

貢獻者指南