From 14cc7053529a7734a9f326becb7f35e4e18ed889 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 5 Aug 2004 13:44:27 -0500 Subject: [svn-r9024] Purpose: Bug fix Description: Correct buffer overrun in "multi" VFL driver that was writing past the end of the "driver name" buffer when encoding the driver info block for the file's superblock. Platforms tested: FreeBSD 4.10 (sleipnir) Too minor to require h5committest --- release_docs/RELEASE.txt | 2 ++ src/H5FDmulti.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 5602b6c..72aae6e 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -170,6 +170,8 @@ Bug Fixes since HDF5-1.6.0 release Library ------- + - Fixed memory overwrite when encoding "multi" file driver information + for file's superblock. QAK - 2004/08/05 - Fixed obscure bug where a filter which failed during chunk allocation could allow library to write uncompressed data to disk but think the data was compressed. QAK - 2004/07/29 diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index f863b55..01048d6 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -804,7 +804,8 @@ H5FD_multi_sb_encode(H5FD_t *_file, char *name/*out*/, #endif /* H5_WANT_H5_V1_6_COMPAT */ /* Name and version number */ - strcpy(name, "NCSAmulti"); + strncpy(name, "NCSAmulti",8); + name[8] = '\0'; assert(7==H5FD_MEM_NTYPES); for (m=H5FD_MEM_SUPER; m