diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2014-02-21 16:59:33 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2014-02-21 16:59:33 (GMT) |
commit | 86d6651b44ce710bea66d7893d97673ead588268 (patch) | |
tree | 773bc8d4e93a3455268cad323c90d80d0906a4f0 /perform | |
parent | 456507476f05e133be004e91d729c93c07a06765 (diff) | |
download | hdf5-86d6651b44ce710bea66d7893d97673ead588268.zip hdf5-86d6651b44ce710bea66d7893d97673ead588268.tar.gz hdf5-86d6651b44ce710bea66d7893d97673ead588268.tar.bz2 |
[svn-r24728] Description:
Bring r24726 & r24727 from trunk to 1.8 branch:
Description:
Revert some earlier usage of strncpy, which was incorrect.
Bring Coverity changes from branch back to trunk:
r20821:
Use HDstrncpy. --gh
(Fixed already, with strdup)
r20822:
(Not merged, incorrect use of HDstrncpy())
r20823:
(Not merged, incorrect use of HDstrncpy())
r20824:
Maintenance: Bug fix: addressed CID 666.
Value stored at *expression_len should be used in the call to
HD5packFstring to avoid overflow (and unnecessary arithmetic
calculation and casting)
r20825:
Issue 642: Added check for error and handler with print to stderr and exit.
r20826:
Undo revision 20818, as that issue has already been fixed in the 1.8 branch
and trunk (but not coverity branch)
r20827:
(Not merged, incorrect use of HDstrncpy())
r20828:
Use HDstrncpy. --gh
(Corrected use of strncpy())
r20829:
Check return of H5Lget_val(print_udata->fid, path, targbuf,
linfo->u.val_size + 1, H5P_DEFAULT) and if error set trgbuf[0] to 0.
Check if H5Lunpack_elink_val(targbuf, linfo->u.val_size, NULL,
&filename, &objname) was successful and allow print. Otherwise filename
and objname are not created. (init those to NULL)
r20830:
resolved coverity issues 939, 940, 941, 944, and 947.
all were complaints about use of sprintf, and in all cases, the
buffers used were large enough for all eventualities.
Resolved issue by replacing calls to sprintf with calls
to snprintf.
r20831:
Maintenance: Addressed CID 852
Replaced sprintf with snprintf
r20832:
Purpose: Fix valgrind issues with hl/examples/ex_image2
Description:
Modified hl/examples/ex_image2 to free global "gbuf" before exit.
Tested on:
Mac OSX/64 10.9.1 (amaon) w/C++, FORTRAN & Threadsafety
(too minor to require h5committest)
Diffstat (limited to 'perform')
-rw-r--r-- | perform/pio_engine.c | 3 | ||||
-rw-r--r-- | perform/sio_engine.c | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/perform/pio_engine.c b/perform/pio_engine.c index 87fa82c..d34fe38 100644 --- a/perform/pio_engine.c +++ b/perform/pio_engine.c @@ -464,7 +464,8 @@ pio_create_filename(iotype iot, const char *base_name, char *fullname, size_t si } else { /* We didn't append the prefix yet */ - HDstrncpy(fullname, prefix, MIN(HDstrlen(prefix), size)); + HDstrncpy(fullname, prefix, size); + fullname[size - 1] = '\0'; } if ((HDstrlen(fullname) + HDstrlen(base_name) + 1) < size) { diff --git a/perform/sio_engine.c b/perform/sio_engine.c index 8539f75..4ce3aa0 100644 --- a/perform/sio_engine.c +++ b/perform/sio_engine.c @@ -371,7 +371,8 @@ sio_create_filename(iotype iot, const char *base_name, char *fullname, size_t si fullname[i] = subdir[j]; } else { /* We didn't append the prefix yet */ - HDstrncpy(fullname, prefix, MIN(HDstrlen(prefix), size)); + HDstrncpy(fullname, prefix, size); + fullname[size - 1] = '\0'; } if ((HDstrlen(fullname) + HDstrlen(base_name) + 1) < size) { |