summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJed Davis <jld@mozilla.com>2016-02-03 14:20:03 +0100
committerJed Davis <jld@mozilla.com>2016-02-03 14:20:03 +0100
commit3aa3e380829bf1b0028685bcd73315b408e23b26 (patch)
treec6c0eb682e21b97fe443de0297325cc44ee5fa0d
parent19bbfd70076c998eeb0f62eb7517d72d779612ef (diff)
downloadnss-hg-3aa3e380829bf1b0028685bcd73315b408e23b26.tar.gz
Bug 1244324 - Fix one-byte buffer overruns in nssutil UTF-8 tests, r=ttaubert
-rw-r--r--lib/util/utf8.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/util/utf8.c b/lib/util/utf8.c
index 2895dc109..9b9bb62d7 100644
--- a/lib/util/utf8.c
+++ b/lib/util/utf8.c
@@ -1576,7 +1576,7 @@ test_multichars
exit(1);
}
- len = 0;
+ len = 1;
for( i = 0; i < sizeof(ucs4)/sizeof(ucs4[0]); i++ ) {
ucs4s[i] = ucs4[i].c;
len += strlen(ucs4[i].utf8);
@@ -1584,7 +1584,7 @@ test_multichars
ucs4_utf8 = (char *)malloc(len);
- len = 0;
+ len = 1;
for( i = 0; i < sizeof(ucs2)/sizeof(ucs2[0]); i++ ) {
ucs2s[i] = ucs2[i].c;
len += strlen(ucs2[i].utf8);