What is a Conditionally Uninitialized Variable? The return value of a function that is potentially used to initialize a local variable is not checked. Therefore, reading the local variable may result in undefined behavior.
2 instances of this defect were found in the following locations:
/* Get variable dimension sizes */
isrecvar = NC_is_recvar(ncid,varid,&numrecs);
NC_getshape(ncid,varid,rank,varshape); <------ HERE
/* Optimize out using various checks */
What is a Conditionally Uninitialized Variable? The return value of a function that is potentially used to initialize a local variable is not checked. Therefore, reading the local variable may result in undefined behavior.
2 instances of this defect were found in the following locations:
Instance 1 File :
libdispatch/dvarget.c
Function:NC_getshape
https://github.com/siva-msft/netcdf-c/blob/894ed2625d911c80bd9037dc01bc6f19cd68ec34/libdispatch/dvarget.c#L207 Code extract:How can I fix it? Correct reference usage found in
libdispatch/dvarput.c
at line112
. https://github.com/siva-msft/netcdf-c/blob/894ed2625d911c80bd9037dc01bc6f19cd68ec34/libdispatch/dvarput.c#L112 Code extract:Instance 2 File :
libdispatch/dvarget.c
Function:NC_getshape
https://github.com/siva-msft/netcdf-c/blob/894ed2625d911c80bd9037dc01bc6f19cd68ec34/libdispatch/dvarget.c#L366 Code extract:How can I fix it? Correct reference usage found in
libdispatch/dvarput.c
at line112
. https://github.com/siva-msft/netcdf-c/blob/894ed2625d911c80bd9037dc01bc6f19cd68ec34/libdispatch/dvarput.c#L112 Code extract: