openbsd-ports/archivers/gshar+gunshar/patches/patch-src_shar_c
naddy 9e1ffe3396 - regen patches
- don't allow argument to overflow buffer (via BugTraq)
2004-04-10 20:28:00 +00:00

22 lines
760 B
Plaintext

$OpenBSD: patch-src_shar_c,v 1.2 2004/04/10 20:28:00 naddy Exp $
--- src/shar.c.orig 1999-09-10 21:20:41.000000000 +0200
+++ src/shar.c 2004-04-10 22:23:15.000000000 +0200
@@ -696,7 +696,7 @@ generate_one_header_line (local_name, re
const char *local_name;
const char *restore_name;
{
- fprintf (output, "# %6ld %s %s\n", struct_stat.st_size,
+ fprintf (output, "# %6ld %s %s\n", (long)struct_stat.st_size,
mode_string (struct_stat.st_mode), restore_name);
return 0;
}
@@ -1905,7 +1905,7 @@ main (argc, argv)
break;
case 'o':
- strcpy (output_base_name, optarg);
+ strlcpy (output_base_name, optarg, sizeof(output_base_name));
if (!strchr (output_base_name, '%'))
strcat (output_base_name, ".%02d");
part_number = 0;