Skip to content

Commit 9e3d919

Browse files
committed
MB-44879: Caught SIGSEGV in libforestdb at (null)
The fix is not addressing the root cause but catches the null pointer access and returns an error. Change-Id: I1ec41fe06ebdf5d2d67d1a46c001de6bf0792cac Reviewed-on: http://review.couchbase.org/c/forestdb/+/149670 Tested-by: Build Bot <[email protected]> Reviewed-by: Srinath Duvuru <[email protected]>
1 parent 9a5b9b0 commit 9e3d919

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/docio.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,10 @@ static int64_t _docio_read_length(struct docio_handle *handle,
772772
err_log_callback *log_callback,
773773
bool read_on_cache_miss)
774774
{
775+
if (handle == NULL || handle->file == NULL){
776+
fdb_log(log_callback, FDB_RESULT_INVALID_ARGS, "Error in reading a doc length");
777+
return FDB_RESULT_INVALID_ARGS;
778+
}
775779
size_t blocksize = handle->file->blocksize;
776780
size_t real_blocksize = blocksize;
777781
bool non_consecutive = ver_non_consecutive_doc(handle->file->version);

0 commit comments

Comments
 (0)