From 9838dba4a402f0d6375fc6aba405ff74a5c73db8 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 19 Oct 2018 14:53:18 -0500 Subject: TRILAB-81 Output error if filename length is greater then 255 --- tools/src/h5import/h5import.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c index ea40322..42ce317 100644 --- a/tools/src/h5import/h5import.c +++ b/tools/src/h5import/h5import.c @@ -88,6 +88,7 @@ int main(int argc, char *argv[]) const char *err7 = "Invalid type of data - %s.\n"; const char *err8 = "Invalid size of data - %s.\n"; const char *err9 = "Cannot specify more than 30 input files in one call to h5import.\n"; + const char *err10 = "Length of output file name limited to 255 chars.\n"; h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); @@ -155,6 +156,10 @@ int main(int argc, char *argv[]) break; case 5: /* get outfile found */ + if (HDstrlen(argv[i]) > 255) { + (void) HDfprintf(stderr, err10, argv[i]); + goto err; + } (void) HDstrcpy(opt.outfile, argv[i]); outfile_named = TRUE; break; -- cgit v0.12