summaryrefslogtreecommitdiff
path: root/Build/source/texk/kpathsea/win32/mktexupdmain.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/kpathsea/win32/mktexupdmain.c')
-rw-r--r--Build/source/texk/kpathsea/win32/mktexupdmain.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/Build/source/texk/kpathsea/win32/mktexupdmain.c b/Build/source/texk/kpathsea/win32/mktexupdmain.c
index 3a52ee3bdce..ccc2fdea642 100644
--- a/Build/source/texk/kpathsea/win32/mktexupdmain.c
+++ b/Build/source/texk/kpathsea/win32/mktexupdmain.c
@@ -1,6 +1,6 @@
/* mktexupdmain.c
- Copyright 2000, 2016 Akira Kakuto.
+ Copyright 2000, 2019 Akira Kakuto.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -19,11 +19,13 @@
#include <kpathsea/kpathsea.h>
#include "mktex.h"
+#define TBUF 512
+
int main(int argc, char **argv)
{
- char dir[256];
- char file[256];
- char path[256];
+ char dir[TBUF];
+ char file[TBUF];
+ char path[TBUF];
size_t i;
kpse_set_program_name (argv[0], NULL);
@@ -31,6 +33,10 @@ int main(int argc, char **argv)
fprintf(stderr, "%s:: usage: %s DIR FILE\n", argv[0], argv[0]);
return 1;
}
+ if (strlen(argv[1]) + strlen(argv[2]) > TBUF - 2) {
+ fprintf (stderr, "Too long a string.\n");
+ exit (100);
+ }
strcpy(dir, argv[1]);
strcpy(file, argv[2]);
normalize (dir);