Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

RE: CGI Security and the null byte problem

by mdillon (Priest)
on Oct 26, 2000 at 11:00 UTC ( #38567=note: print w/ replies, xml ) Need Help??


in reply to CGI Security and the null byte problem

speaking of null byte problems, i was once bit while trying to do join("\0", array('a', 'b', 'c')) in some PHP code.

it doesn't work!

the result is (in hex):

61 62 63 00 00

one could say, perhaps, that there is a moral to all this...

use perl;

for those to whom it isn't apparent, the correct result (which are easily produced by the equivalent Perl, join "\0", qw(a b c)) is:

61 00 62 00 63


Comment on RE: CGI Security and the null byte problem
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://38567]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (15)
As of 2014-08-20 14:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (115 votes), past polls