develooper Front page | perl.perl5.porters | Postings from April 2012

[perl #112478] use asking for very large module version number raises panic: snprintf buffer overflow

Thread Previous | Thread Next
From:
Father Chrysostomos via RT
Date:
April 16, 2012 18:36
Subject:
[perl #112478] use asking for very large module version number raises panic: snprintf buffer overflow
Message ID:
rt-3.6.HEAD-10677-1334626579-1815.112478-15-0@perl.org
On Mon Apr 16 18:22:11 2012, sprout wrote:
> On Mon Apr 16 13:45:32 2012, b_jonas wrote:
> >  * on irc, vincent says 'the culprit is the first call to my_sprintf()
> > in
> >       upg_version()'
> 
> And I’m trying to figure out why.

It’s trying to write this to a 64-char buffer:

$ perl -le 'printf "%.9f\n", 9e99'
8999999999999999948859130765266355329578537025198862586562510896759102769772101980841694466750283776.000000000

Most parts of the perl source code that create static buffers check to
see whether that buffer is big enough and use a different code path if
it is not.

This part needs to do the same.

In fact, even if your version number is high enough, you get the same error:

$ perl -e '$VERSION = 10**70; VERSION main 10**70'
panic: snprintf buffer overflow at -e line 1.

-- 

Father Chrysostomos


---
via perlbug:  queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=112478

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About