aboutsummaryrefslogtreecommitdiff
path: root/src/open_lib.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2019-04-06 15:00:01 +0200
committerEven Rouault <even.rouault@spatialys.com>2019-04-06 15:00:01 +0200
commit89e5fe47cf695579cfec82907d8ba5abbd22ec86 (patch)
tree3796710408f984d085b51784b598684a0f29c750 /src/open_lib.cpp
parent0ea2b4e82700ba9aa0ae67ec0ee72ae58bc4f0c9 (diff)
downloadPROJ-89e5fe47cf695579cfec82907d8ba5abbd22ec86.tar.gz
PROJ-89e5fe47cf695579cfec82907d8ba5abbd22ec86.zip
pj_open_lib_ex(): avoid false positive Coverity Scan warning abount nullptr dereference. CID 202725
Diffstat (limited to 'src/open_lib.cpp')
-rw-r--r--src/open_lib.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/open_lib.cpp b/src/open_lib.cpp
index 68477996..01f626e8 100644
--- a/src/open_lib.cpp
+++ b/src/open_lib.cpp
@@ -34,6 +34,7 @@
#define FROM_PROJ_CPP
#endif
+#include <assert.h>
#include <errno.h>
#include <stddef.h>
#include <stdio.h>
@@ -239,6 +240,7 @@ pj_open_lib_ex(projCtx ctx, const char *name, const char *mode,
sysname = name;
}
+ assert(sysname); // to make Coverity Scan happy
if ( fid != nullptr || (fid = pj_ctx_fopen(ctx, sysname, mode)) != nullptr)
{
if( out_full_filename != nullptr && out_full_filename_size > 0 )