diff options
author | drh <drh@noemail.net> | 2019-12-19 21:11:48 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2019-12-19 21:11:48 +0000 |
commit | 6ad0e25fa41bf51f6ee5302ac62842cf5546223d (patch) | |
tree | 9289c8af188fc5155fae619ec4cd13190f1f6b7e /ext/misc/regexp.c | |
parent | 8654186b0236d556aa85528c2573ee0b6ab71be3 (diff) | |
download | sqlite-6ad0e25fa41bf51f6ee5302ac62842cf5546223d.tar.gz sqlite-6ad0e25fa41bf51f6ee5302ac62842cf5546223d.zip |
Fix the regexp extension so that it correctly translates all over-length
3-byte UTF8 sequences into 0xfffd.
FossilOrigin-Name: 3d4c0bf8904135fa68c75801bfa738715cacc3b19dc8ad6ef550b11798d4b121
Diffstat (limited to 'ext/misc/regexp.c')
-rw-r--r-- | ext/misc/regexp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/misc/regexp.c b/ext/misc/regexp.c index 3359109ab..a97290511 100644 --- a/ext/misc/regexp.c +++ b/ext/misc/regexp.c @@ -156,7 +156,7 @@ static unsigned re_next_char(ReInput *p){ && (p->z[p->i+1]&0xc0)==0x80 ){ c = (c&0x0f)<<12 | ((p->z[p->i]&0x3f)<<6) | (p->z[p->i+1]&0x3f); p->i += 2; - if( c<=0x3ff || (c>=0xd800 && c<=0xdfff) ) c = 0xfffd; + if( c<=0x7ff || (c>=0xd800 && c<=0xdfff) ) c = 0xfffd; }else if( (c&0xf8)==0xf0 && p->i+3<p->mx && (p->z[p->i]&0xc0)==0x80 && (p->z[p->i+1]&0xc0)==0x80 && (p->z[p->i+2]&0xc0)==0x80 ){ c = (c&0x07)<<18 | ((p->z[p->i]&0x3f)<<12) | ((p->z[p->i+1]&0x3f)<<6) |