file upgraded to version 5.36
[dragora.git] / patches / scrot / 07_fix-formatstring.patch
blobb78f385b3668bd05997235f1d5c79d0617034c02
1 Description: Prevent arbitrary long file names
2 Author: George Danchev <danchev@spnet.net>
3 Last-Update: 2009-10-25
4 Index: scrot-0.8/src/options.c
5 ===================================================================
6 --- scrot-0.8.orig/src/options.c
7 +++ scrot-0.8/src/options.c
8 @@ -124,6 +124,12 @@ scrot_parse_option_array(int argc, char
9 if (!opt.output_file)
11 opt.output_file = argv[optind++];
13 + if ( strlen(opt.output_file) > 256 ) {
14 + printf("output filename too long.\n");
15 + exit(EXIT_FAILURE);
16 + }
18 if (opt.thumb)
19 opt.thumb_file = name_thumbnail(opt.output_file);