aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2021-03-07 19:18:58 +0100
committerEven Rouault <even.rouault@spatialys.com>2021-03-07 19:18:58 +0100
commitc021126079afa2e77416a673818abac6512eba69 (patch)
tree1f9df11c2b49e88881aedf320b25cdd45fe841a3 /src
parentb0fa082511744402e1a5c46a9f17728745163e88 (diff)
downloadPROJ-c021126079afa2e77416a673818abac6512eba69.tar.gz
PROJ-c021126079afa2e77416a673818abac6512eba69.zip
pipeline: avoid CLang Static Analyzer 10.0 likely false positive about dereferencing a nullptr
Diffstat (limited to 'src')
-rw-r--r--src/pipeline.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pipeline.cpp b/src/pipeline.cpp
index b1989824..88793027 100644
--- a/src/pipeline.cpp
+++ b/src/pipeline.cpp
@@ -465,8 +465,8 @@ PJ *OPERATION(pipeline,0) {
return destructor (P, PROJ_ERR_OTHER /*ENOMEM*/);
/* Do some syntactical sanity checking */
- for (i = 0; i < argc; i++) {
- if (0==strcmp (argv_sentinel, argv[i])) {
+ for (i = 0; i < argc && argv[i] != nullptr; i++) {
+ if ( 0==strcmp (argv_sentinel, argv[i])) {
if (-1==i_pipeline) {
proj_log_error (P, _("Pipeline: +step before +proj=pipeline"));
return destructor (P, PROJ_ERR_INVALID_OP_WRONG_SYNTAX);