summaryrefslogtreecommitdiffstats
path: root/src/server
diff options
context:
space:
mode:
authorSimon Rettberg2020-07-21 17:34:14 +0200
committerSimon Rettberg2020-07-21 17:34:14 +0200
commit632528507c4cc1e7ba414bfaccfe6125bb1b0625 (patch)
tree9be0b99c4d3d7614a9d2443d2e2cd83914a7f6bb /src/server
parent[SERVER] Fix: No replication if autoFreeDiskSpaceDelay is disabled (diff)
downloaddnbd3-632528507c4cc1e7ba414bfaccfe6125bb1b0625.tar.gz
dnbd3-632528507c4cc1e7ba414bfaccfe6125bb1b0625.tar.xz
dnbd3-632528507c4cc1e7ba414bfaccfe6125bb1b0625.zip
[SERVER] Fix: NULL pointer access in saveLoadAllCacheMaps()
Entries in _images array might ne NULL
Diffstat (limited to 'src/server')
-rw-r--r--src/server/image.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/server/image.c b/src/server/image.c
index 4893b7e..efece62 100644
--- a/src/server/image.c
+++ b/src/server/image.c
@@ -1874,6 +1874,8 @@ static void* saveLoadAllCacheMaps(void* nix UNUSED)
mutex_lock( &imageListLock );
for ( int i = 0; i < _num_images; ++i ) {
dnbd3_image_t * const image = _images[i];
+ if ( image == NULL )
+ continue;
image->users++;
mutex_unlock( &imageListLock );
const bool fromUpstream = isImageFromUpstream( image );