We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 356b31d commit 2ec6c18Copy full SHA for 2ec6c18
libsrc/var.c
@@ -485,6 +485,8 @@ NC_var_shape(NC_var *varp, const NC_dimarray *dims)
485
/*if(!(shp == varp->shape && IS_RECVAR(varp)))*/
486
if( shp != NULL && (shp != varp->shape || !IS_RECVAR(varp)))
487
{
488
+ if(product <= 0)
489
+ return NC_ERANGE;
490
if( ((off_t)(*shp)) <= OFF_T_MAX / product )
491
492
product *= (*shp > 0 ? (off_t)*shp : 1);
0 commit comments