Tentative, robust fix for https://github.com/Unidata/netcdf-c/issues/221 that does not immediately introduce other issues into ncdump. Broader validation pending.

This commit is contained in:
Ward Fisher 2016-02-18 15:42:03 -07:00
parent bb7b0d3f32
commit db84f39adc
2 changed files with 30 additions and 9 deletions

33
gdb.txt
View File

@ -1,20 +1,37 @@
set breakpoint pending on
break nc4hdf.c:872
command
watch provide_fill
c
end
break vardata.c:473
command
watch vals
end
break dumplib.c:1063
command
print len
end
break ncdump.c:1687
break nc4hdf.c:1126
run tst_empty_vlen_unlim.nc
#----------
# Solved first set of problems. On to second, in print_any_val.
#---------
#set breakpoint pending on
#
#break nc4hdf.c:872
#command
#watch provide_fill
#c
#end
#break nc4hdf.c:974
#command
#print fill_value_size
#end
#break nc4hdf.c:1126

View File

@ -1159,7 +1159,11 @@ nc4_get_vara(NC *nc, int ncid, int varid, const size_t *startp,
*(char **)filldata = NULL;
}
else if(var->type_info->nc_type_class == NC_VLEN) {
continue;
if(fillvalue) {
memcpy(filldata,fillvalue,file_type_size);
} else {
*(char **)filldata = NULL;
}
} else
memcpy(filldata, fillvalue, file_type_size);
filldata = (char *)filldata + file_type_size;