summaryrefslogtreecommitdiffstats
path: root/base/third_party
diff options
context:
space:
mode:
authorwtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-13 04:52:12 +0000
committerwtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-13 04:52:12 +0000
commita4b76e8a5a25662ab10a1c58ec699b7be143409d (patch)
tree84e76bbce8db0508bee5a00fbe11f737ff1a59e3 /base/third_party
parent87b2ac05737422f030f219858cf51aa7c78089f6 (diff)
downloadchromium_src-a4b76e8a5a25662ab10a1c58ec699b7be143409d.zip
chromium_src-a4b76e8a5a25662ab10a1c58ec699b7be143409d.tar.gz
chromium_src-a4b76e8a5a25662ab10a1c58ec699b7be143409d.tar.bz2
Merge the fix for NSPR bug 689188.
Cast char to unsigned char before passing it to isalpha to prevent it from becoming a negative integer if char is a signed type. See https://bugzilla.mozilla.org/show_bug.cgi?id=689188. R=mark@chromium.org BUG=none TEST=none Review URL: http://codereview.chromium.org/9691017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126338 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/third_party')
-rw-r--r--base/third_party/nspr/prtime.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/base/third_party/nspr/prtime.cc b/base/third_party/nspr/prtime.cc
index 8075795..5fc89c5 100644
--- a/base/third_party/nspr/prtime.cc
+++ b/base/third_party/nspr/prtime.cc
@@ -1043,8 +1043,9 @@ PR_ParseTimeString(
/* "-" is ignored at the beginning of a token if we have not yet
parsed a year (e.g., the second "-" in "30-AUG-1966"), or if
the character after the dash is not a digit. */
- if (*rest == '-' && ((rest > string && isalpha(rest[-1]) && year < 0)
- || rest[1] < '0' || rest[1] > '9'))
+ if (*rest == '-' && ((rest > string &&
+ isalpha((unsigned char)rest[-1]) && year < 0) ||
+ rest[1] < '0' || rest[1] > '9'))
{
rest++;
goto SKIP_MORE;