mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-02-17 16:50:18 +08:00
Corrected two possible ‘uninitialized variable’, ‘dereference null pointer’ bugs identified via clang static analysis.
This commit is contained in:
parent
1d7ec898ff
commit
d484b9ac33
7
oc2/oc.c
7
oc2/oc.c
@ -967,7 +967,7 @@ OCerror
|
||||
oc_data_fieldbyname(OCobject link, OCobject datanode, const char* name, OCobject* fieldp)
|
||||
{
|
||||
OCerror err = OC_NOERR;
|
||||
size_t count,i;
|
||||
size_t i=0,count=0;
|
||||
OCobject ddsnode;
|
||||
OCVERIFY(OC_State,link);
|
||||
OCVERIFY(OC_Data,datanode);
|
||||
@ -1292,7 +1292,10 @@ oc_data_octype(OCobject link, OCobject datanode, OCtype* typep)
|
||||
|
||||
OCASSERT(data->template != NULL);
|
||||
if(typep == NULL) ocerr = OC_EINVAL;
|
||||
else *typep = data->template->octype;
|
||||
else if(data->template)
|
||||
*typep = data->template->octype;
|
||||
else
|
||||
ocerr = OC_EINVAL;
|
||||
return ocerr;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user