From 26bfa6e19e3eed192092dc298a7d234daadb4a7d Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Sun, 13 Jul 2008 04:04:31 +0000 Subject: [PATCH] assert() that the pointer passed to Perl_sv_chop() lies within the buffer of the SV. p4raw-id: //depot/perl@34136 --- sv.c | 4 ++++ 1 file changed, 4 insertions(+) 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 */ -- 1.8.3.1