mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-02-23 16:59:54 +08:00
enable nc_open to check the number of large variables allowed in CDF-1 and CDF-2 files
This commit is contained in:
parent
8481819096
commit
68a57832d6
@ -418,6 +418,9 @@ nc_put_rec(int ncid, size_t recnum, void *const *datap);
|
||||
|
||||
/* End defined in putget.c */
|
||||
|
||||
extern int
|
||||
NC_check_vlens(NC3_INFO *ncp);
|
||||
|
||||
/* Define accessors for the dispatchdata */
|
||||
#define NC3_DATA(nc) ((NC3_INFO*)(nc)->dispatchdata)
|
||||
#define NC3_DATA_SET(nc,data) ((nc)->dispatchdata = (void*)(data))
|
||||
|
@ -680,7 +680,7 @@ move_vars_r(NC3_INFO *gnu, NC3_INFO *old)
|
||||
* Given a valid ncp, return NC_EVARSIZE if any variable has a bad len
|
||||
* (product of non-rec dim sizes too large), else return NC_NOERR.
|
||||
*/
|
||||
static int
|
||||
int
|
||||
NC_check_vlens(NC3_INFO *ncp)
|
||||
{
|
||||
NC_var **vpp;
|
||||
|
@ -1520,6 +1520,10 @@ nc_get_NC(NC3_INFO* ncp)
|
||||
if(status != NC_NOERR)
|
||||
goto unwind_get;
|
||||
|
||||
status = NC_check_vlens(ncp);
|
||||
if(status != NC_NOERR)
|
||||
goto unwind_get;
|
||||
|
||||
unwind_get:
|
||||
(void) rel_v1hs(&gs);
|
||||
return status;
|
||||
|
Loading…
Reference in New Issue
Block a user