diff options
author | 2009-11-03 14:24:09 +0000 | |
---|---|---|
committer | 2009-11-03 14:24:09 +0000 | |
commit | d886bcfeff3966f63b8fdff847d1e46374e3863f (patch) | |
tree | db6af8d078f772eda7bda3214730479016806e49 /gnu/usr.bin/perl/regexec.c | |
parent | print the correct info (need some tweaks yet to be shorter). (diff) | |
download | wireguard-openbsd-d886bcfeff3966f63b8fdff847d1e46374e3863f.tar.xz wireguard-openbsd-d886bcfeff3966f63b8fdff847d1e46374e3863f.zip |
- apply fix from upstream git for CVE-2009-3626, which could cause perl to
crash on certain invalid UTF-8 codes.
ok millert@ sthen@
Diffstat (limited to 'gnu/usr.bin/perl/regexec.c')
-rw-r--r-- | gnu/usr.bin/perl/regexec.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/gnu/usr.bin/perl/regexec.c b/gnu/usr.bin/perl/regexec.c index 7a42c4f82db..32994debff3 100644 --- a/gnu/usr.bin/perl/regexec.c +++ b/gnu/usr.bin/perl/regexec.c @@ -1006,16 +1006,15 @@ Perl_re_intuit_start(pTHX_ REGEXP * const prog, SV *sv, char *strpos, #define REXEC_TRIE_READ_CHAR(trie_type, trie, widecharmap, uc, uscan, len, \ uvc, charid, foldlen, foldbuf, uniflags) STMT_START { \ - UV uvc_unfolded = 0; \ switch (trie_type) { \ case trie_utf8_fold: \ if ( foldlen>0 ) { \ - uvc_unfolded = uvc = utf8n_to_uvuni( uscan, UTF8_MAXLEN, &len, uniflags ); \ + uvc = utf8n_to_uvuni( uscan, UTF8_MAXLEN, &len, uniflags ); \ foldlen -= len; \ uscan += len; \ len=0; \ } else { \ - uvc_unfolded = uvc = utf8n_to_uvuni( (U8*)uc, UTF8_MAXLEN, &len, uniflags ); \ + uvc = utf8n_to_uvuni( (U8*)uc, UTF8_MAXLEN, &len, uniflags ); \ uvc = to_uni_fold( uvc, foldbuf, &foldlen ); \ foldlen -= UNISKIP( uvc ); \ uscan = foldbuf + UNISKIP( uvc ); \ @@ -1041,7 +1040,6 @@ uvc, charid, foldlen, foldbuf, uniflags) STMT_START { \ uvc = (UV)*uc; \ len = 1; \ } \ - \ if (uvc < 256) { \ charid = trie->charmap[ uvc ]; \ } \ @@ -1054,9 +1052,6 @@ uvc, charid, foldlen, foldbuf, uniflags) STMT_START { \ charid = (U16)SvIV(*svpp); \ } \ } \ - if (!charid && trie_type == trie_utf8_fold && !UTF) { \ - charid = trie->charmap[uvc_unfolded]; \ - } \ } STMT_END #define REXEC_FBC_EXACTISH_CHECK(CoNd) \ |