diff options
author | Sean McBride <sean@rogue-research.com> | 2024-02-13 14:22:17 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-13 14:22:17 (GMT) |
commit | f309fcebbd777f4d2664775ac6582f3c0bcd1396 (patch) | |
tree | 1b853ab43bd83d56205f7b9cb9f26538724fcd2c /utils/tools | |
parent | beee0a327d75f826407aecae04581c930d06aad5 (diff) | |
download | hdf5-f309fcebbd777f4d2664775ac6582f3c0bcd1396.zip hdf5-f309fcebbd777f4d2664775ac6582f3c0bcd1396.tar.gz hdf5-f309fcebbd777f4d2664775ac6582f3c0bcd1396.tar.bz2 |
Issue #1824: Replaced most remaining sprintf with safer snprint (#4003)
Diffstat (limited to 'utils/tools')
-rw-r--r-- | utils/tools/h5dwalk/h5dwalk.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/utils/tools/h5dwalk/h5dwalk.c b/utils/tools/h5dwalk/h5dwalk.c index b510f3e..f994a90 100644 --- a/utils/tools/h5dwalk/h5dwalk.c +++ b/utils/tools/h5dwalk/h5dwalk.c @@ -1209,10 +1209,10 @@ MFU_PRED_EXEC(mfu_flist flist, uint64_t idx, void *arg) snprintf(cmdline, sizeof(cmdline), "\n---------\nCommand:"); b_offset = strlen(cmdline); for (k = 0; k < count; k++) { - sprintf(&cmdline[b_offset], " %s", argv[k]); + snprintf(&cmdline[b_offset], sizeof(cmdline) - b_offset, " %s", argv[k]); b_offset = strlen(cmdline); } - sprintf(&cmdline[b_offset], "\n"); + snprintf(&cmdline[b_offset], sizeof(cmdline) - b_offset, "\n"); run_command(count, argv, cmdline, fname); mfu_free(argv); |