mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-03-31 17:50:26 +08:00
Corrected a static-analysis detected error state where a null pointer could be passed to strcmp
This commit is contained in:
parent
d8733e501b
commit
c053de5d0c
@ -1165,14 +1165,15 @@ fprintf(stderr,"conflict: %s[%lu] %s[%lu]\n",
|
||||
PANIC1("missing dim names: %s",dim1->ocname);
|
||||
/* search backward so we can delete duplicates */
|
||||
for(j=nclistlength(basedims)-1;j>i;j--) {
|
||||
CDFnode* dim2 = (CDFnode*)nclistget(basedims,j);
|
||||
if(strcmp(dim1->ncfullname,dim2->ncfullname)==0) {
|
||||
if(!dim1->ncfullname) continue;
|
||||
CDFnode* dim2 = (CDFnode*)nclistget(basedims,j);
|
||||
if(strcmp(dim1->ncfullname,dim2->ncfullname)==0) {
|
||||
/* complain and suppress one of them */
|
||||
fprintf(stderr,"duplicate dim names: %s[%lu] %s[%lu]\n",
|
||||
dim1->ncfullname,(unsigned long)dim1->dim.declsize,
|
||||
dim2->ncfullname,(unsigned long)dim2->dim.declsize);
|
||||
dim1->ncfullname,(unsigned long)dim1->dim.declsize,
|
||||
dim2->ncfullname,(unsigned long)dim2->dim.declsize);
|
||||
nclistremove(basedims,j);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user