Skip to content
This repository was archived by the owner on Mar 22, 2023. It is now read-only.

Commit 2405ce2

Browse files
committed
contiguous_iterator: do not call snapshot_range for default-constructed iterator
Origianl implementation resulted in the following array_iterator_noconv_0_test failure under UBSAN: "runtime error: applying non-zero offset 4 to null pointer"
1 parent 1c37736 commit 2405ce2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/libpmemobj++/experimental/contiguous_iterator.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018-2020, Intel Corporation
2+
* Copyright 2018-2021, Intel Corporation
33
*
44
* Redistribution and use in source and binary forms, with or without
55
* modification, are permitted provided that the following conditions
@@ -245,7 +245,7 @@ struct range_snapshotting_iterator
245245
{
246246
assert(data <= ptr);
247247

248-
if (snapshot_size > 0)
248+
if (snapshot_size && ptr)
249249
snapshot_range(ptr);
250250
}
251251

0 commit comments

Comments
 (0)