id summary reporter owner description type status priority milestone component version severity resolution keywords cc 6227 Buffer overflow potential in netcdf driver Kurt Schwehr warmerdam "https://www.unidata.ucar.edu/software/netcdf/docs/netcdf-c/nc_005finq_005fvar.html - note the ""''declare your array to be size NC_MAX_NAME+1''"" part {{{ Usage int nc_inq_var (int ncid, int varid, char *name, nc_type *xtypep, int *ndimsp, int dimids[], int *nattsp); int nc_inq_varname (int ncid, int varid, char *name); int nc_inq_vartype (int ncid, int varid, nc_type *xtypep); int nc_inq_varndims (int ncid, int varid, int *ndimsp); int nc_inq_vardimid (int ncid, int varid, int dimids[]); int nc_inq_varnatts (int ncid, int varid, int *nattsp); ncid NetCDF ID, from a previous call to nc_open or nc_create. varid Variable ID. name Returned variable name. The caller must allocate space for the returned name. The maximum possible length, in characters, of a variable name is given by the predefined constant NC_MAX_NAME. (This doesn't include the null terminator, so declare your array to be size NC_MAX_NAME+1). The returned character array will be null-terminated. }}} e.g. {{{#!c++ CPLErr netCDFRasterBand::CreateBandMetadata( int *paDimIds ) { netCDFDataset *poDS = reinterpret_cast( this->poDS ); /* -------------------------------------------------------------------- */ /* Compute all dimensions from Band number and save in Metadata */ /* -------------------------------------------------------------------- */ char szVarName[NC_MAX_NAME]; nc_inq_varname( cdfid, nZId, szVarName ); }}}" defect closed normal 1.11.4 GDAL_Raster unspecified normal fixed netcdf