void-packages/srcpkgs/scrot/patches/07_fix-formatstring.patch
crater2150 2b9193d473 scrot: add debian patchset
Closes: #9241 [via git-merge-pr]
2017-12-16 01:30:04 +01:00

20 lines
659 B
Diff

Description: Prevent arbitrary long file names
Author: George Danchev <danchev@spnet.net>
Last-Update: 2009-10-25
Index: src/options.c
===================================================================
--- src/options.c
+++ src/options.c
@@ -124,6 +124,12 @@ scrot_parse_option_array(int argc, char
if (!opt.output_file)
{
opt.output_file = argv[optind++];
+
+ if ( strlen(opt.output_file) > 256 ) {
+ printf("output filename too long.\n");
+ exit(EXIT_FAILURE);
+ }
+
if (opt.thumb)
opt.thumb_file = name_thumbnail(opt.output_file);
}