Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Fix parsing UTF16 nums with multi-digit exponents |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
667cfd8694a448eda3e6a3d16b72f499 |
User & Date: | peterreid 2013-10-25 01:33:52.142 |
Context
2013-10-25
| ||
02:37 | Fix buffer overread when parsing a UTF16 exponent check-in: 9e61c90be4 user: peterreid tags: trunk | |
01:33 | Fix parsing UTF16 nums with multi-digit exponents check-in: 667cfd8694 user: peterreid tags: trunk | |
01:27 | Test sqlite4_num_from_text with UTF16BE and UTF16LE check-in: 9c4e33cc5b user: peterreid tags: trunk | |
Changes
Changes to src/math.c.
︙ | ︙ | |||
417 418 419 420 421 422 423 424 425 426 427 428 429 430 | if( c=='.' ){ /* Permit only a single radix in each number */ if( seenRadix ) goto finished; seenRadix = 1; bReal = 1; }else if( c=='e' || c=='E' ){ int f = (flags & (SQLITE4_PREFIX_ONLY|SQLITE4_IGNORE_WHITESPACE)); sqlite4_num exp; exp = sqlite4_num_from_text(&zIn[i+incr], nIn-i-incr, f, 0); if( sqlite4_num_isnan(exp) ) goto finished; if( exp.e || exp.m>999 ) goto finished; bReal = 1; r.e += (int)(exp.m) * (exp.sign ? -1 : 1); i = nIn; | > | 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 | if( c=='.' ){ /* Permit only a single radix in each number */ if( seenRadix ) goto finished; seenRadix = 1; bReal = 1; }else if( c=='e' || c=='E' ){ int f = (flags & (SQLITE4_PREFIX_ONLY|SQLITE4_IGNORE_WHITESPACE)); if( incr==2 ) f |= SQLITE4_UTF16LE; sqlite4_num exp; exp = sqlite4_num_from_text(&zIn[i+incr], nIn-i-incr, f, 0); if( sqlite4_num_isnan(exp) ) goto finished; if( exp.e || exp.m>999 ) goto finished; bReal = 1; r.e += (int)(exp.m) * (exp.sign ? -1 : 1); i = nIn; |
︙ | ︙ |
Changes to test/num.test.
︙ | ︙ | |||
221 222 223 224 225 226 227 | } $out } #------------------------------------------------------------------------- # Test from UTF16BE text # foreach {tn in len out} { | | > | > | 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 | } $out } #------------------------------------------------------------------------- # Test from UTF16BE text # foreach {tn in len out} { 0 274 -1 274 1 3e+484 -1 3e+484 } { do_test num-9.3.$tn { sqlite4_num_to_text [sqlite4_num_from_text $in $len b] } $out } #------------------------------------------------------------------------- # Test from UTF16LE text # foreach {tn in len out} { 0 4639 -1 4639 1 5e+388 -1 5e+388 } { do_test num-9.3.$tn { sqlite4_num_to_text [sqlite4_num_from_text $in $len l] } $out } foreach {tn in out} { |
︙ | ︙ |