diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2014-11-04 09:45:49 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2014-11-04 09:45:49 +0000 |
commit | 1eadfad4cc79e4a378d88212773503122bc77ccc (patch) | |
tree | af6d9a6e135e66a35952fa44c053abb5c10b4590 /Build/source/texk/dvipdfm-x | |
parent | c8cfc68dc6c935e993e0f35864a9f8b010cf1650 (diff) |
texk/dvipdfm-x: Avoid undefined behaviour when char is signed
git-svn-id: svn://tug.org/texlive/trunk@35507 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvipdfm-x')
-rw-r--r-- | Build/source/texk/dvipdfm-x/ChangeLog | 1 | ||||
-rw-r--r-- | Build/source/texk/dvipdfm-x/pdfparse.c | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/Build/source/texk/dvipdfm-x/ChangeLog b/Build/source/texk/dvipdfm-x/ChangeLog index 3809f8f13b3..32f8b7bf20d 100644 --- a/Build/source/texk/dvipdfm-x/ChangeLog +++ b/Build/source/texk/dvipdfm-x/ChangeLog @@ -1,6 +1,7 @@ 2014-11-04 Peter Breitenlohner <peb@mppmu.mpg.de> * pkfont.c: Fix the messed up formatting codes. + * pdfparse.c: Avoid undefined behaviour when char is signed. 2014-11-03 Shunsaku Hirata <shunsaku.hirata74@gmail.com> diff --git a/Build/source/texk/dvipdfm-x/pdfparse.c b/Build/source/texk/dvipdfm-x/pdfparse.c index ab874ff11f0..b29dd64da74 100644 --- a/Build/source/texk/dvipdfm-x/pdfparse.c +++ b/Build/source/texk/dvipdfm-x/pdfparse.c @@ -240,7 +240,7 @@ parse_pdf_number (const char **pp, const char *endptr) p = *pp; skip_white(&p, endptr); if (p >= endptr || - (!isdigit(p[0]) && p[0] != '.' && + (!isdigit((unsigned char)p[0]) && p[0] != '.' && p[0] != '+' && p[0] != '-')) { WARN("Could not find a numeric object."); return NULL; @@ -270,7 +270,7 @@ parse_pdf_number (const char **pp, const char *endptr) } else { has_dot = 1; } - } else if (isdigit(p[0])) { + } else if (isdigit((unsigned char)p[0])) { if (has_dot) { v += (p[0] - '0') / pow(10, nddigits + 1); nddigits++; |