From c8b2184409475876361e6933f7179f5dbbe57d64 Mon Sep 17 00:00:00 2001 From: Dennis Heimbigner Date: Fri, 20 Oct 2017 21:17:12 -0600 Subject: [PATCH 1/3] Fix dap4 related warnings in https://github.com/Unidata/netcdf-c/issues/501. The nc_test/util.c error is a typo. The libdap4/d4meta.c error only is shown when using a 64 bit machine because then |size_t| == 64 bits and |int| = 32bits. --- libdap4/d4meta.c | 8 ++++---- nc_test/util.c | 4 ---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/libdap4/d4meta.c b/libdap4/d4meta.c index a0c4c428b..af74603a9 100644 --- a/libdap4/d4meta.c +++ b/libdap4/d4meta.c @@ -42,7 +42,7 @@ static int decodeEconst(NCD4meta* builder, NCD4node* enumtype, const char* nameo static int downConvert(union ATOMICS* converter, NCD4node* type); static void freeStringMemory(char** mem, int count); static size_t getDimrefs(NCD4node* var, int* dimids); -static size_t getDimsizes(NCD4node* var, size_t* dimsizes); +static size_t getDimsizes(NCD4node* var, int* dimsizes); static void reclaimNode(NCD4node* node); static d4size_t getpadding(d4size_t offset, size_t alignment); static int markdapsize(NCD4meta* meta); @@ -523,7 +523,7 @@ buildCompound(NCD4meta* builder, NCD4node* cmpdtype, NCD4node* group, char* name /* Step 3: add the fields to type */ for(i=0;ivars);i++) { int rank; - size_t dimsizes[NC_MAX_VAR_DIMS]; + int dimsizes[NC_MAX_VAR_DIMS]; NCD4node* field = (NCD4node*)nclistget(cmpdtype->vars,i); rank = nclistlength(field->dims); if(rank == 0) { /* scalar */ @@ -681,13 +681,13 @@ getDimrefs(NCD4node* var, int* dimids) } static size_t -getDimsizes(NCD4node* var, size_t* dimsizes) +getDimsizes(NCD4node* var, int* dimsizes) { int i; int rank = nclistlength(var->dims); for(i=0;idims,i); - dimsizes[i] = dim->dim.size; + dimsizes[i] = (int)dim->dim.size; } return rank; } diff --git a/nc_test/util.c b/nc_test/util.c index 33b53234b..127b56bf9 100644 --- a/nc_test/util.c +++ b/nc_test/util.c @@ -21,10 +21,6 @@ int inRange(const double value, const nc_type xtype) { switch (xtype) { - double min = 0.0; - double max = 0.0; - - case NC_CHAR: return value >= X_CHAR_MIN && value <= X_CHAR_MAX; case NC_BYTE: return value >= X_BYTE_MIN && value <= X_BYTE_MAX; case NC_SHORT: return value >= X_SHORT_MIN && value <= X_SHORT_MAX; From 6a71bf81b1b663387c0f0ca9e41ab24601c678c5 Mon Sep 17 00:00:00 2001 From: Ed Hartnett Date: Mon, 23 Oct 2017 09:49:38 -0600 Subject: [PATCH 2/3] fixed memory problem in tst_h_dimscales --- h5_test/tst_h_dimscales.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/h5_test/tst_h_dimscales.c b/h5_test/tst_h_dimscales.c index 73c817d58..349b1a836 100644 --- a/h5_test/tst_h_dimscales.c +++ b/h5_test/tst_h_dimscales.c @@ -85,7 +85,7 @@ rec_scan_group(hid_t grpid) } else { - int visitor_data = 0; + hid_t visitor_data = 0; /* Here's how to get the number of scales attached * to the dataset's dimension 0. */ @@ -379,7 +379,7 @@ main() if ((grpid = H5Gopen(fileid, GRP_NAME)) < 0) ERR; /* Loop through datasets to find variables. */ - if (H5Gget_num_objs(grpid, &num_obj) < 0) ERR; + if (H5Gget_num_objs(grpid, (hsize_t *)&num_obj) < 0) ERR; for (i=0; i Date: Mon, 23 Oct 2017 15:54:17 -0600 Subject: [PATCH 3/3] Updated release notes in support of https://github.com/Unidata/netcdf-c/pulls/511 --- RELEASE_NOTES.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 1a9caad43..0497fcff5 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -5,6 +5,11 @@ Release Notes {#RELEASE_NOTES} This file contains a high-level description of this package's evolution. Releases are in reverse chronological order (most recent first). Note that, as of netcdf 4.2, the `netcdf-c++` and `netcdf-fortran` libraries have been separated into their own libraries. + +## 4.5.1 - TBD + +* Corrected a memory overflow in `tst_h_dimscales`, see [Github #511](https://github.com/Unidata/netcdf-c/issues/511), [Github #505](https://github.com/Unidata/netcdf-c/issues/505), [Github #363](https://github.com/Unidata/netcdf-c/issues/363) and [Github #244](https://github.com/Unidata/netcdf-c/issues/244) for more information. + ## 4.5.0 - October 20, 2017 * Corrected an issue which could potential result in a hang while using parallel file I/O. See [Github #449](https://github.com/Unidata/netcdf-c/pull/449) for more information.