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

[perl #113980] [PATCH] pp_syscall: "I32 retval" truncates the returned value

Thread Previous | Thread Next
From:
Father Chrysostomos via RT
Date:
July 4, 2012 09:08
Subject:
[perl #113980] [PATCH] pp_syscall: "I32 retval" truncates the returned value
Message ID:
rt-3.6.HEAD-28836-1341418093-672.113980-15-0@perl.org
On Wed Jul 04 05:56:04 2012, oleg@redhat.com wrote:
> Hello,
> 
> I noticed today that syscall(9, ...) (mmap) doesn't work for me.
> 
> The problem is obvious, pp_syscall() uses I32 for retval and the
> "long" address doesn't fit into "int".
> 
> The one-liner below should fix the problem. I am not sure where
> should I send this patch, how should I write the changelog, etc.
> IOW, sorry if my email doesn't conform the rules.
> 
> And btw, thanks to all perl developers for perl ;)
> 
> Oleg.
> 
> --- a/pp_sys.c
> +++ b/pp_sys.c
> @@ -5456,7 +5456,7 @@ PP(pp_syscall)
>      register I32 items = SP - MARK;
>      unsigned long a[20];
>      register I32 i = 0;
> -    I32 retval = -1;
> +    IV retval = -1;
>  
>      if (PL_tainting) {
>  	while (++MARK <= SP) {
> 

Thank you.  Applied as f9344c91a4.  I don’t supposed it’s possible to
write an automated test for this, is it?

-- 

Father Chrysostomos


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

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