Skip to content
quotesby

About this quote

What does it mean?
The code copies the maximum temporary string size to a base variable, humorously protecting the string.
In plain terms
It saves the max size to keep the string safe.
What can you take from it?
Preserve original limits before modifying them.

Where it applies

  • buffer overflow prevention
  • legacy code maintenance

Putting it to work

  • store limits before changes
  • add protective checks

Questions to consider

  • What risks does this protect against?
  • Is the naming clear enough?

Another view

The comment is vague; actual protection may be insufficient.

More from Larry Wall

  1. str->str_pok |= SP_FBM; /* deep magic */ s = (unsigned char*)(str->str_ptr); /* deeper magic */

    Permalink to quote #246
  2. /* And you'll never guess what the dog had */ /* in its mouth... */

    Permalink to quote #241
  3. echo 'Hmmm...you don't have Berkeley networking in libc.a...' echo 'but the Wollongong group seems to have hacked it in.

    Permalink to quote #248

Related quotes

  1. But the possibility of abuse may be a good reason for leaving capabilities out of other computer languages, it's not a good reason for leaving capabilities out…

    Larry WallLarry Wall quote #122
  2. Well, you can implement a Perl peek() with unpack('P',...). Once you have that, there's only security through obscurity. :-)

    Larry WallLarry Wall quote #140
  3. Russia does not have in its possession any trustworthy data that supports the existence of nuclear weapons or any weapons of mass destruction in Iraq and we ha…

    Vladimir PutinVladimir Putin quote #1