summaryrefslogtreecommitdiffstats
path: root/tools/test/h5repack/h5repack.sh.in
diff options
context:
space:
mode:
authorLarry Knox <lrknox@hdfgroup.org>2021-10-26 02:17:44 (GMT)
committerGitHub <noreply@github.com>2021-10-26 02:17:44 (GMT)
commit8d1fe4416429d8a902f042b280fc3a438e9ba0bf (patch)
tree738ffecdf8468722790e3651eb41800b2b4bdd2e /tools/test/h5repack/h5repack.sh.in
parentaee9e06aa8ff85397a54f7955d62466d39b23ddc (diff)
downloadhdf5-8d1fe4416429d8a902f042b280fc3a438e9ba0bf.zip
hdf5-8d1fe4416429d8a902f042b280fc3a438e9ba0bf.tar.gz
hdf5-8d1fe4416429d8a902f042b280fc3a438e9ba0bf.tar.bz2
H5repack tests should fail if a corrupted file causes h5repack to (#1138)
* H5repack tests should fail if a corrupted file causes h5repack to segfault/core dump. * Add release note for HDFV-10590, CVE-2018-17432.
Diffstat (limited to 'tools/test/h5repack/h5repack.sh.in')
-rw-r--r--tools/test/h5repack/h5repack.sh.in17
1 files changed, 14 insertions, 3 deletions
diff --git a/tools/test/h5repack/h5repack.sh.in b/tools/test/h5repack/h5repack.sh.in
index 3756a95..1e54670 100644
--- a/tools/test/h5repack/h5repack.sh.in
+++ b/tools/test/h5repack/h5repack.sh.in
@@ -885,13 +885,24 @@ TOOLTEST_FAIL()
(
cd $TESTDIR
$ENVCMD $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile
- ) >$actual
+ ) >&$actual
RET=$?
- if [ $RET == 0 ] ; then
+
+ # Normally h5repack of files tested with this function are expected
+ # to return not 0, but if the command results in "Segmentation fault"
+ # or "core dumped" it is a failure regardless of the return value.
+ failure=`grep -e 'Segmentation fault' -e 'core dumped' $actual`
+ if [ "$failure" != "" ]; then
nerrors="`expr $nerrors + 1`"
echo " FAILED"
+ echo " $failure"
else
- echo " PASSED"
+ if [ $RET == 0 ] ; then
+ nerrors="`expr $nerrors + 1`"
+ echo " FAILED"
+ else
+ echo " PASSED"
+ fi
fi
rm -f $outfile
}