Skip to content

Commit d49920c

Browse files
committed
Fix bad length in snprintf
1 parent db5f887 commit d49920c

File tree

3 files changed

+9
-16
lines changed

3 files changed

+9
-16
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
matrix:
3434
os: [ubuntu-22.04, ubuntu-latest]
3535
build_system: ["autotools", "cmake"]
36-
python-version: ["3.10", "3.11", "3.12"]
36+
python-version: ["3.10"]
3737
hdf5-branch: ["hdf5_1_14", "develop"]
3838
compiler: ["gcc-11", "gcc-12", "gcc-13"]
3939
exclude:

src/rest_vol.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3164,10 +3164,9 @@ RV_convert_dataspace_shape_to_JSON(hid_t space_id, char **shape_body, char **max
31643164
strcat(maxdims_out_string_curr_pos++, "0");
31653165
} /* end if */
31663166
else {
3167-
if ((bytes_printed =
3168-
snprintf(maxdims_out_string_curr_pos,
3169-
maxdims_out_string_new_len - (size_t)maxdims_out_string_curr_pos,
3170-
"%s%" PRIuHSIZE, i > 0 ? "," : "", maxdims[i])) < 0)
3167+
if ((bytes_printed = snprintf(maxdims_out_string_curr_pos,
3168+
maxdims_out_string_new_len - (size_t)buf_ptrdiff,
3169+
"%s%" PRIuHSIZE, i > 0 ? "," : "", maxdims[i])) < 0)
31713170
FUNC_GOTO_ERROR(H5E_DATASPACE, H5E_SYSERRSTR, FAIL, "snprintf error");
31723171
maxdims_out_string_curr_pos += bytes_printed;
31733172
} /* end else */

src/rest_vol_config.h.in

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
/* Define to 1 if you have the <mach/mach_time.h> header file. */
3131
#undef HAVE_MACH_MACH_TIME_H
3232

33+
/* Define to 1 if you have the <memory.h> header file. */
34+
#undef HAVE_MEMORY_H
35+
3336
/* Define to 1 if you have the <setjmp.h> header file. */
3437
#undef HAVE_SETJMP_H
3538

@@ -45,9 +48,6 @@
4548
/* Define to 1 if you have the <stdint.h> header file. */
4649
#undef HAVE_STDINT_H
4750

48-
/* Define to 1 if you have the <stdio.h> header file. */
49-
#undef HAVE_STDIO_H
50-
5151
/* Define to 1 if you have the <stdlib.h> header file. */
5252
#undef HAVE_STDLIB_H
5353

@@ -81,9 +81,6 @@
8181
/* Define to 1 if you have the <unistd.h> header file. */
8282
#undef HAVE_UNISTD_H
8383

84-
/* Whether HDF5 version is at least 2.0.0 */
85-
#undef HDF5_2
86-
8784
/* Define to the sub-directory where libtool stores uninstalled libraries. */
8885
#undef LT_OBJDIR
8986

@@ -114,13 +111,10 @@
114111
/* The size of `off_t', as computed by sizeof. */
115112
#undef SIZEOF_OFF_T
116113

117-
/* Define to 1 if all of the C90 standard headers exist (not just the ones
118-
required in a freestanding environment). This macro is provided for
119-
backward compatibility; new code need not use it. */
114+
/* Define to 1 if you have the ANSI C header files. */
120115
#undef STDC_HEADERS
121116

122-
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. This
123-
macro is obsolete. */
117+
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
124118
#undef TIME_WITH_SYS_TIME
125119

126120
/* Define to have the REST VOL track memory usage. */

0 commit comments

Comments
 (0)