summaryrefslogtreecommitdiffstats
path: root/crypto/heimdal/lib/wind/utf8.c
diff options
context:
space:
mode:
authorstas <stas@FreeBSD.org>2012-04-08 08:19:17 +0000
committerstas <stas@FreeBSD.org>2012-04-08 08:19:17 +0000
commite98d05b4f007c4c6849229bc6c5f1586d0207896 (patch)
treeb776209adefb14f82be8f607e6cc465dfddd90c3 /crypto/heimdal/lib/wind/utf8.c
parent614fd4fe5e7e76da2328df84ca390b36dad17e79 (diff)
downloadFreeBSD-src-e98d05b4f007c4c6849229bc6c5f1586d0207896.zip
FreeBSD-src-e98d05b4f007c4c6849229bc6c5f1586d0207896.tar.gz
- Update FreeBSD's Heimdal distribution to 1.5.2. This is a bugfix
release, which fixes a DoS issue in libkrb5.
Diffstat (limited to 'crypto/heimdal/lib/wind/utf8.c')
-rw-r--r--crypto/heimdal/lib/wind/utf8.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/crypto/heimdal/lib/wind/utf8.c b/crypto/heimdal/lib/wind/utf8.c
index 6907b3c..e1a1eb7 100644
--- a/crypto/heimdal/lib/wind/utf8.c
+++ b/crypto/heimdal/lib/wind/utf8.c
@@ -204,13 +204,13 @@ wind_ucs4utf8(const uint32_t *in, size_t in_len, char *out, size_t *out_len)
switch(len) {
case 4:
out[3] = (ch | 0x80) & 0xbf;
- ch = ch << 6;
+ ch = ch >> 6;
case 3:
out[2] = (ch | 0x80) & 0xbf;
- ch = ch << 6;
+ ch = ch >> 6;
case 2:
out[1] = (ch | 0x80) & 0xbf;
- ch = ch << 6;
+ ch = ch >> 6;
case 1:
out[0] = ch | first_char[len - 1];
}
@@ -346,8 +346,8 @@ wind_ucs2write(const uint16_t *in, size_t in_len, unsigned int *flags,
return WIND_ERR_OVERRUN;
if ((*flags) & WIND_RW_LE) {
- p[0] = (bom >> 8) & 0xff;
- p[1] = (bom ) & 0xff;
+ p[0] = (bom ) & 0xff;
+ p[1] = (bom >> 8) & 0xff;
} else {
p[1] = (bom ) & 0xff;
p[0] = (bom >> 8) & 0xff;
@@ -360,8 +360,8 @@ wind_ucs2write(const uint16_t *in, size_t in_len, unsigned int *flags,
if (len < 2)
return WIND_ERR_OVERRUN;
if ((*flags) & WIND_RW_LE) {
- p[0] = (in[0] >> 8) & 0xff;
- p[1] = (in[0] ) & 0xff;
+ p[0] = (in[0] ) & 0xff;
+ p[1] = (in[0] >> 8) & 0xff;
} else {
p[1] = (in[0] ) & 0xff;
p[0] = (in[0] >> 8) & 0xff;
@@ -479,10 +479,10 @@ wind_ucs2utf8(const uint16_t *in, size_t in_len, char *out, size_t *out_len)
switch(len) {
case 3:
out[2] = (ch | 0x80) & 0xbf;
- ch = ch << 6;
+ ch = ch >> 6;
case 2:
out[1] = (ch | 0x80) & 0xbf;
- ch = ch << 6;
+ ch = ch >> 6;
case 1:
out[0] = ch | first_char[len - 1];
}
OpenPOWER on IntegriCloud