summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Build/source/texk/dvipsk/ChangeLog6
-rw-r--r--Build/source/texk/dvipsk/emspecial.c11
2 files changed, 14 insertions, 3 deletions
diff --git a/Build/source/texk/dvipsk/ChangeLog b/Build/source/texk/dvipsk/ChangeLog
index 1420b758993..e2a23921888 100644
--- a/Build/source/texk/dvipsk/ChangeLog
+++ b/Build/source/texk/dvipsk/ChangeLog
@@ -1,5 +1,11 @@
2009-12-14 Karl Berry <karl@tug.org>
+ * emspecial.c (emspecial):
+ Increase size of emunit to 30.
+ Increase size of emstr to 250.
+ Attempt to check that we don't overflow emstr.
+ Report from Alexander, tlsec 02 Dec 2009 00:28:33.
+
* pc: remove obsolete subdir.
* Makefile.am (EXTRA_DIST): rm.
diff --git a/Build/source/texk/dvipsk/emspecial.c b/Build/source/texk/dvipsk/emspecial.c
index 6edfcbf0ed4..8b455d4c94d 100644
--- a/Build/source/texk/dvipsk/emspecial.c
+++ b/Build/source/texk/dvipsk/emspecial.c
@@ -140,8 +140,8 @@ emspecial(char *p)
float emwidth, emheight;
shalfword empoint1, empoint2;
struct empt *empoint;
-char emunit[3];
-char emstr[80];
+char emunit[30];
+char emstr[250];
char *emp;
#ifndef KPATHSEA
void emgraph();
@@ -277,8 +277,13 @@ void emgraph();
else if (strncmp(emp, "graph", 5) == 0) {
int i;
for (emp = emp+5; *emp && isspace(*emp); emp++); /* skip blanks */
- for (i=0; *emp && !isspace(*emp) && !(*emp==',') ; emp++)
+ for (i=0; *emp && !isspace(*emp) && !(*emp==',') ; emp++) {
+ if (strlen(emstr) - 2 >= sizeof(emstr)) {
+ fprintf(stderr, "em:graph: special too long, truncating\n") ;
+ break;
+ }
emstr[i++] = *emp; /* copy filename */
+ }
emstr[i] = '\0';
/* now get optional width and height */
emwidth = emheight = -1.0; /* no dimension is <= 0 */