openbsd-ports/x11/vlc/patches/patch-src_text_unicode_c
ajacoutot 2c8260b4ae SECURITY:
- MMS: Fix stack overflow. SA-1201
- RealRTSP: Fix heap overflows. SA-1202
- ty: Fix out of bound read on corrupt files.
- Avoid char conversion in strchr().
- Fix surrogate detection.

from Brad (maintainer)
2012-03-21 08:27:29 +00:00

16 lines
635 B
Plaintext

$OpenBSD: patch-src_text_unicode_c,v 1.1 2012/03/21 08:27:29 ajacoutot Exp $
Fix surrogate detection.
--- src/text/unicode.c.orig Tue Mar 20 16:33:48 2012
+++ src/text/unicode.c Tue Mar 20 16:34:24 2012
@@ -348,7 +348,7 @@ size_t vlc_towc (const char *str, uint32_t *restrict p
return -1;
cp |= (c & 0x3f) << 6;
- if (unlikely(cp >= 0xD800 && cp < 0xC000)) // UTF-16 surrogate
+ if (unlikely(cp >= 0xD800 && cp < 0xE000)) // UTF-16 surrogate
return -1;
if (unlikely(cp < (1u << (5 * charlen - 4)))) // non-ASCII overlong
return -1;