enable nc_open to check the number of large variables allowed in CDF-1 and CDF-2 files

This commit is contained in:
Wei-keng Liao 2017-04-03 22:07:36 -05:00
parent 8481819096
commit 68a57832d6
3 changed files with 8 additions and 1 deletions

View File

@ -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))

View File

@ -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;

View File

@ -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;