Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^8: Why do poisoned null attacks still work ?

by ikegami (Patriarch)
on Jul 23, 2009 at 03:43 UTC ( [id://782550]=note: print w/replies, xml ) Need Help??


in reply to Re^7: Why do poisoned null attacks still work ?
in thread Why do poisoned null attacks still work ?

Unlike C, the end of a Perl string is determined by a field outside of the string's payload. This allows Perl strings to contain any characters, including NUL.

As protection against XS authors who treat the string payload as a C string, Perl strings usually have an extra byte allocated, set to NUL. As I understand it, this is a courtesy, not a guarantee.

Replies are listed 'Best First'.
Re^9: Why do poisoned null attacks still work ?
by ysth (Canon) on Jul 26, 2009 at 20:18 UTC
    AFAIK Perl itself is completely safe in this regard, but from XS you can (and in some cases would want to) create scalars that don't comply (for instance, pointing into some larger block of allocated memory).

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-03-19 03:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found