From 89e5fe47cf695579cfec82907d8ba5abbd22ec86 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sat, 6 Apr 2019 15:00:01 +0200 Subject: pj_open_lib_ex(): avoid false positive Coverity Scan warning abount nullptr dereference. CID 202725 --- src/open_lib.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/open_lib.cpp') 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 #include #include #include @@ -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 ) -- cgit v1.2.3