From a414fc9af8129aab052312921cf273704e61481a Mon Sep 17 00:00:00 2001 From: Wei-keng Liao Date: Wed, 13 Sep 2017 11:39:38 -0500 Subject: [PATCH] For record variables: throw NC_EVARSIZE when detecting a variable larger then X_INT64_MAX - 3 for CDF-5 files --- libsrc/nc3internal.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libsrc/nc3internal.c b/libsrc/nc3internal.c index b0a31855d..6e8c79b5f 100644 --- a/libsrc/nc3internal.c +++ b/libsrc/nc3internal.c @@ -747,6 +747,8 @@ NC_check_vlens(NC3_INFO *ncp) if( IS_RECVAR(*vpp) ) { last = 0; if( NC_check_vlen(*vpp, vlen_max) == 0 ) { + if (fIsSet(ncp->flags,NC_64BIT_DATA)) /* too big for CDF-5 */ + return NC_EVARSIZE; large_vars_count++; last = 1; }