diff options
author | Hugo van der Sanden <hv@crypt.org> | 2015-02-23 16:48:15 +0000 |
---|---|---|
committer | Hugo van der Sanden <hv@crypt.org> | 2015-03-09 22:15:46 +0000 |
commit | 22ff313068aa37b1a24855e760e71ee9a20a1a90 (patch) | |
tree | 09da195258e4a85e42a39dd24d7c60c849409ef1 /utf8.c | |
parent | 35cd12d12a5a5777098caf722f8748b39c3be45f (diff) | |
download | perl-22ff313068aa37b1a24855e760e71ee9a20a1a90.tar.gz |
[perl #123814] replace grok_atou with grok_atoUV
Some questions and loose ends:
XXX gv.c:S_gv_magicalize - why are we using SSize_t for paren?
XXX mg.c:Perl_magic_set - need appopriate error handling for $)
XXX regcomp.c:S_reg - need to check if we do the right thing if parno
was not grokked
Perl_get_debug_opts should probably return something unsigned; not sure
if that's something we can change.
Diffstat (limited to 'utf8.c')
-rw-r--r-- | utf8.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -3549,7 +3549,9 @@ Perl__swash_to_invlist(pTHX_ SV* const swash) /* The first number is a count of the rest */ l++; - elements = grok_atou((const char *)l, &after_atou); + if (!grok_atoUV((const char *)l, &elements, &after_atou)) { + Perl_croak(aTHX_ "panic: Expecting a valid count of elements at start of inversion list"); + } if (elements == 0) { invlist = _new_invlist(0); } @@ -3559,7 +3561,9 @@ Perl__swash_to_invlist(pTHX_ SV* const swash) /* Get the 0th element, which is needed to setup the inversion list */ while (isSPACE(*l)) l++; - element0 = (UV) grok_atou((const char *)l, &after_atou); + if (!grok_atoUV((const char *)l, &element0, &after_atou)) { + Perl_croak(aTHX_ "panic: Expecting a valid 0th element for inversion list"); + } l = (U8 *) after_atou; invlist = _setup_canned_invlist(elements, element0, &other_elements_ptr); elements--; @@ -3570,7 +3574,9 @@ Perl__swash_to_invlist(pTHX_ SV* const swash) Perl_croak(aTHX_ "panic: Expecting %"UVuf" more elements than available", elements); } while (isSPACE(*l)) l++; - *other_elements_ptr++ = (UV) grok_atou((const char *)l, &after_atou); + if (!grok_atoUV((const char *)l, other_elements_ptr++, &after_atou)) { + Perl_croak(aTHX_ "panic: Expecting a valid element in inversion list"); + } l = (U8 *) after_atou; } } |