diff options
author | Sean McBride <sean@rogue-research.com> | 2022-01-28 22:43:48 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-28 22:43:48 (GMT) |
commit | 4ac6ccc0213767be935b2686524937ae93c46e3f (patch) | |
tree | 9cd332106bd623c05f8e6837bed0d1ceab5ad7e9 /src/H5PLpath.c | |
parent | ad71539d30c799c497953c18352df37d83a75310 (diff) | |
download | hdf5-4ac6ccc0213767be935b2686524937ae93c46e3f.zip hdf5-4ac6ccc0213767be935b2686524937ae93c46e3f.tar.gz hdf5-4ac6ccc0213767be935b2686524937ae93c46e3f.tar.bz2 |
Snprintf2 (#1399)
* Replaced many uses of sprintf with safer snprintf
Many very straightforward, but in a few cases added a length parameter to some private functions, because buffer length was otherwise unknowable.
* Removed unnecessary use of static on small buffers
This improves thread safety.
* Committing clang-format changes
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'src/H5PLpath.c')
-rw-r--r-- | src/H5PLpath.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/H5PLpath.c b/src/H5PLpath.c index 87ff831..b86fd6e 100644 --- a/src/H5PLpath.c +++ b/src/H5PLpath.c @@ -709,7 +709,7 @@ H5PL__path_table_iterate_process_path(const char *plugin_path, H5PL_iterate_type /* Specify a file mask. *.* = We want everything! - * skip the path if the directory can't be opened */ - HDsprintf(service, "%s\\*.dll", plugin_path); + HDsnprintf(service, sizeof(service), "%s\\*.dll", plugin_path); if ((hFind = FindFirstFileA(service, &fdFile)) == INVALID_HANDLE_VALUE) HGOTO_DONE(H5_ITER_CONT) @@ -934,7 +934,7 @@ H5PL__find_plugin_in_path(const H5PL_search_params_t *search_params, hbool_t *fo *found = FALSE; /* Specify a file mask. *.* = We want everything! */ - HDsprintf(service, "%s\\*.dll", dir); + HDsnprintf(service, sizeof(service), "%s\\*.dll", dir); if ((hFind = FindFirstFileA(service, &fdFile)) == INVALID_HANDLE_VALUE) HGOTO_ERROR(H5E_PLUGIN, H5E_OPENERROR, FAIL, "can't open directory") |