summaryrefslogtreecommitdiff
path: root/backend/dvi/mdvi-lib/dviread.c
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-12-10 00:58:36 +0100
committerinfirit <[email protected]>2014-12-10 00:58:36 +0100
commita828cb1a5c0835d08a17c86f64d571436f93f980 (patch)
tree6ad1a50b5854ffe240a46f2572b170c599efbfd1 /backend/dvi/mdvi-lib/dviread.c
parentb2d02d6471176fdb0e42dbe05ffaee90a933a239 (diff)
downloadatril-a828cb1a5c0835d08a17c86f64d571436f93f980.tar.bz2
atril-a828cb1a5c0835d08a17c86f64d571436f93f980.tar.xz
backends: Fix several security issues in the dvi-backend.
See CVE-2010-2640, CVE-2010-2641, CVE-2010-2642 and CVE-2010-2643. Taken from evince commit: d4139205b010ed06310d14284e63114e88ec6de2 From: José Aliste <[email protected]>
Diffstat (limited to 'backend/dvi/mdvi-lib/dviread.c')
-rw-r--r--backend/dvi/mdvi-lib/dviread.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/backend/dvi/mdvi-lib/dviread.c b/backend/dvi/mdvi-lib/dviread.c
index cd8cfa91..d0143205 100644
--- a/backend/dvi/mdvi-lib/dviread.c
+++ b/backend/dvi/mdvi-lib/dviread.c
@@ -1507,6 +1507,10 @@ int special(DviContext *dvi, int opcode)
Int32 arg;
arg = dugetn(dvi, opcode - DVI_XXX1 + 1);
+ if (arg <= 0) {
+ dvierr(dvi, _("malformed special length\n"));
+ return -1;
+ }
s = mdvi_malloc(arg + 1);
dread(dvi, s, arg);
s[arg] = 0;