tag 716616 patch
thanks

Hi all! :-)

This crash happens whenever the input file given to mincconcat somehow indicates that it's compressed (e.g. by having an extension ".bz2", ".gz", etc.), but doesn't really contain data in the corresponding compression format.

I've added a check for that case in order to give a reasonable error message before exiting cleanly instead of just crashing. Please find the patch attached.

Cheers,
Martin

Description: Fix crash in mincconcat when header cannot be expanded
 This patch fixes a segmentation fault that occurs when an input
 file has a filename extension that indicates compression (e.g.
 ".bz2"), but doesn't really contain content in the corresponding
 compression format. In this case exit with an error message instead
 of just crashing.
Author: Martin Steghöfer <mar...@steghoefer.eu>
Bug-Debian: http://bugs.debian.org/716616

--- a/progs/mincconcat/mincconcat.c
+++ b/progs/mincconcat/mincconcat.c
@@ -701,6 +701,10 @@
 
    /* Expand the file header and open the file */
    filename = miexpand_file(first_filename, NULL, TRUE, &created_tempfile);
+   if (!filename) {
+      fprintf(stderr, "Could not expand file \"%s\"!\n", first_filename);
+      exit(EXIT_FAILURE);
+   }
    input_mincid = miopen(filename, NC_NOWRITE);
    if (created_tempfile) {
       (void) remove(filename);

Reply via email to