develooper Front page | perl.perl5.porters | Postings from January 2009

Re: [PATCH] Fix array out-of-bounds error in utfebcdic.h

Thread Previous | Thread Next
From:
karl williamson
Date:
January 31, 2009 12:29
Subject:
Re: [PATCH] Fix array out-of-bounds error in utfebcdic.h
Message ID:
4984B491.9090607@khwilliamson.com
karl williamson wrote:
> Fix array out-of-bounds error in utfebcdic.h
> 
> The UTF_START_MARK macro does a left shift, the result of which is used 
> as an index into a 256-byte array.  This causes a segfault.  Actually, 
> the expression desired is just the lower 256 bits of the result, so can 
>  cast to get rid of the upper bits.
> 
> I also corrected and added a comment, and removed the trailing commas in 
> the array initializations that somewhere in the Perl documentation it 
> says that these are bad.
> 
In looking over this patch, I realized it would be better to add a 
surrounding pair of parentheses, so here is it revised.

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