Fixed buffer overflow in demo/demo.c with gesture -iso_read.

Debian bug 774147. Thanks to Jakub Wilk.
This commit is contained in:
Thomas Schmitt 2014-12-29 15:08:47 +01:00
parent 5c6ce72c02
commit 0611f468c2

View File

@ -1,6 +1,6 @@
/* /*
* Copyright (c) 2007 - 2009 Vreixo Formoso, Thomas Schmitt * Copyright (c) 2007 - 2014 Vreixo Formoso, Thomas Schmitt
* *
* This file is part of the libisofs project; you can redistribute it and/or * This file is part of the libisofs project; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2 * modify it under the terms of the GNU General Public License version 2
@ -446,6 +446,7 @@ iso_read_print_dir(IsoFileSource *dir, int level)
sp[i+1] = ' '; sp[i+1] = ' ';
} }
if (level > 0)
sp[level * 2 - 1] = '-'; sp[level * 2 - 1] = '-';
sp[level * 2] = '\0'; sp[level * 2] = '\0';
@ -551,7 +552,7 @@ int gesture_iso_cat(int argc, char **argv)
IsoReadOpts *opts; IsoReadOpts *opts;
if (argc != 3) { if (argc != 3) {
fprintf(stderr, "Usage: isocat /path/to/image /path/to/file\n"); fprintf(stderr, "Usage: -iso_cat /path/to/image /path/to/file\n");
return 1; return 1;
} }