From: Nicholas Clark Date: Sun, 13 Jul 2008 04:04:31 +0000 (+0000) Subject: assert() that the pointer passed to Perl_sv_chop() lies within the X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=26bfa6e19e3eed192092dc298a7d234daadb4a7d;p=p5sagit%2Fp5-mst-13.2.git assert() that the pointer passed to Perl_sv_chop() lies within the buffer of the SV. p4raw-id: //depot/perl@34136 --- diff --git a/sv.c b/sv.c index 6ac3408..cdae779 100644 --- a/sv.c +++ b/sv.c @@ -4401,6 +4401,10 @@ Perl_sv_chop(pTHX_ register SV *const sv, register const char *const ptr) } assert(ptr > SvPVX_const(sv)); SV_CHECK_THINKFIRST(sv); + if (SvLEN(sv)) + assert(delta <= SvLEN(sv)); + else + assert(delta <= SvCUR(sv)); if (!SvOOK(sv)) { if (!SvLEN(sv)) { /* make copy of shared string */