|
|
6fb0ed |
diff -up diffutils-3.6/lib/quotearg.c.covscan diffutils-3.6/lib/quotearg.c
|
|
|
6fb0ed |
--- diffutils-3.6/lib/quotearg.c.covscan 2017-05-20 02:14:05.000000000 +0200
|
|
|
6fb0ed |
+++ diffutils-3.6/lib/quotearg.c 2018-08-13 14:20:54.934196535 +0200
|
|
|
6fb0ed |
@@ -886,8 +886,9 @@ quotearg_n_options (int n, char const *a
|
|
|
6fb0ed |
if (nslots <= n)
|
|
|
6fb0ed |
{
|
|
|
6fb0ed |
bool preallocated = (sv == &slotvec0);
|
|
|
6fb0ed |
-
|
|
|
6fb0ed |
- if (MIN (INT_MAX, MIN (PTRDIFF_MAX, SIZE_MAX) / sizeof *sv) <= n)
|
|
|
6fb0ed |
+ int nmax = MIN (INT_MAX, MIN (PTRDIFF_MAX, SIZE_MAX) / sizeof *sv) - 1;
|
|
|
6fb0ed |
+
|
|
|
6fb0ed |
+ if (nmax < n)
|
|
|
6fb0ed |
xalloc_die ();
|
|
|
6fb0ed |
|
|
|
6fb0ed |
slotvec = sv = xrealloc (preallocated ? NULL : sv, (n + 1) * sizeof *sv);
|
|
|
6fb0ed |
diff -up diffutils-3.6/src/diff.h.covscan diffutils-3.6/src/diff.h
|
|
|
6fb0ed |
--- diffutils-3.6/src/diff.h.covscan 2018-08-13 14:20:54.931196520 +0200
|
|
|
6fb0ed |
+++ diffutils-3.6/src/diff.h 2018-08-13 14:20:54.935196541 +0200
|
|
|
6fb0ed |
@@ -392,7 +392,7 @@ extern void print_sdiff_script (struct c
|
|
|
6fb0ed |
extern char const change_letter[4];
|
|
|
6fb0ed |
extern char const pr_program[];
|
|
|
6fb0ed |
extern char *concat (char const *, char const *, char const *);
|
|
|
6fb0ed |
-extern bool (*lines_differ) (char const *, size_t, char const *, size_t) _GL_ATTRIBUTE_PURE;
|
|
|
6fb0ed |
+extern bool (*lines_differ) (char const *, size_t, char const *, size_t);
|
|
|
6fb0ed |
extern bool lines_differ_singlebyte (char const *, size_t, char const *, size_t) _GL_ATTRIBUTE_PURE;
|
|
|
6fb0ed |
#ifdef HANDLE_MULTIBYTE
|
|
|
6fb0ed |
extern bool lines_differ_multibyte (char const *, size_t, char const *, size_t) _GL_ATTRIBUTE_PURE;
|
|
|
6fb0ed |
diff -up diffutils-3.6/src/ifdef.c.covscan diffutils-3.6/src/ifdef.c
|
|
|
6fb0ed |
--- diffutils-3.6/src/ifdef.c.covscan 2017-05-18 19:39:59.000000000 +0200
|
|
|
6fb0ed |
+++ diffutils-3.6/src/ifdef.c 2018-08-13 14:20:54.935196541 +0200
|
|
|
6fb0ed |
@@ -362,20 +362,14 @@ do_printf_spec (FILE *out, char const *s
|
|
|
6fb0ed |
printint print_value = value;
|
|
|
6fb0ed |
size_t spec_prefix_len = f - spec - 2;
|
|
|
6fb0ed |
size_t pI_len = sizeof pI - 1;
|
|
|
6fb0ed |
-#if 0
|
|
|
6fb0ed |
- char format[spec_prefix_len + pI_len + 2];
|
|
|
6fb0ed |
-#else
|
|
|
6fb0ed |
char *format = xmalloc (spec_prefix_len + pI_len + 2);
|
|
|
6fb0ed |
-#endif
|
|
|
6fb0ed |
char *p = format + spec_prefix_len + pI_len;
|
|
|
6fb0ed |
memcpy (format, spec, spec_prefix_len);
|
|
|
6fb0ed |
memcpy (format + spec_prefix_len, pI, pI_len);
|
|
|
6fb0ed |
*p++ = c;
|
|
|
6fb0ed |
*p = '\0';
|
|
|
6fb0ed |
fprintf (out, format, print_value);
|
|
|
6fb0ed |
-#if ! HAVE_C_VARARRAYS
|
|
|
6fb0ed |
free (format);
|
|
|
6fb0ed |
-#endif
|
|
|
6fb0ed |
}
|
|
|
6fb0ed |
}
|
|
|
6fb0ed |
break;
|
|
|
6fb0ed |
diff -up diffutils-3.6/src/sdiff.c.covscan diffutils-3.6/src/sdiff.c
|
|
|
6fb0ed |
--- diffutils-3.6/src/sdiff.c.covscan 2018-08-13 14:41:13.969450849 +0200
|
|
|
6fb0ed |
+++ diffutils-3.6/src/sdiff.c 2018-08-13 14:44:07.877344103 +0200
|
|
|
6fb0ed |
@@ -230,8 +230,10 @@ cleanup (int signo __attribute__((unused
|
|
|
6fb0ed |
if (0 < diffpid)
|
|
|
6fb0ed |
kill (diffpid, SIGPIPE);
|
|
|
6fb0ed |
#endif
|
|
|
6fb0ed |
- if (tmpname)
|
|
|
6fb0ed |
+ if (tmpname) {
|
|
|
6fb0ed |
unlink (tmpname);
|
|
|
6fb0ed |
+ free (tmpname);
|
|
|
6fb0ed |
+ }
|
|
|
6fb0ed |
}
|
|
|
6fb0ed |
|
|
|
6fb0ed |
static void exiterr (void) __attribute__((noreturn));
|
|
|
6fb0ed |
@@ -685,6 +687,7 @@ main (int argc, char *argv[])
|
|
|
6fb0ed |
if (tmpname)
|
|
|
6fb0ed |
{
|
|
|
6fb0ed |
unlink (tmpname);
|
|
|
6fb0ed |
+ free (tmpname);
|
|
|
6fb0ed |
tmpname = 0;
|
|
|
6fb0ed |
}
|
|
|
6fb0ed |
|