diff options
author | John Peacock <jpeacock@cpan.org> | 2013-12-09 18:23:20 -0500 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2014-01-04 05:10:04 -0800 |
commit | 4141ef59170e80715499432a2f4b9bfca704247d (patch) | |
tree | 93f4ab025eaf75ea9cc3738663a13cd40a58bebf /vutil.c | |
parent | 0f6a6701e55132200d4390809b1b292ab0a709ad (diff) | |
download | perl-4141ef59170e80715499432a2f4b9bfca704247d.tar.gz |
Integrate CPAN version.pm release into core
Diffstat (limited to 'vutil.c')
-rw-r--r-- | vutil.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -596,10 +596,19 @@ Perl_upg_version(pTHX_ SV *ver, bool qv) qv = TRUE; } #endif + else if ( (SvUOK(ver) && SvUVX(ver) > VERSION_MAX) + || (SvIOK(ver) && SvIVX(ver) > VERSION_MAX) ) { + STRLEN len; + char tbuf[64]; + len = my_snprintf(tbuf, sizeof(tbuf), "%d", VERSION_MAX); + version = savepvn(tbuf, len); + Perl_ck_warner(aTHX_ packWARN(WARN_OVERFLOW), + "Integer overflow in version %d",VERSION_MAX); + } else /* must be a string or something like a string */ { STRLEN len; - version = savepv(SvPV(ver,len)); + version = savepvn(SvPV(ver,len), SvCUR(ver)); #ifndef SvVOK # if PERL_VERSION > 5 /* This will only be executed for 5.6.0 - 5.8.0 inclusive */ |