From: Nicholas Clark Date: Sun, 16 Apr 2006 12:06:57 +0000 (+0000) Subject: In Perl_sv_usepvn_flags, assert() that the caller has RTFM. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2e90b4cd9b8959c8a9cede0cb14ef5338ec93d49;p=p5sagit%2Fp5-mst-13.2.git In Perl_sv_usepvn_flags, assert() that the caller has RTFM. p4raw-id: //depot/perl@27842 --- diff --git a/sv.c b/sv.c index 247ab31..308ecf8 100644 --- a/sv.c +++ b/sv.c @@ -3920,6 +3920,9 @@ Perl_sv_usepvn_flags(pTHX_ SV *sv, char *ptr, STRLEN len, U32 flags) if (SvPVX_const(sv)) SvPV_free(sv); + if (flags & SV_HAS_TRAILING_NUL) + assert(ptr[len] == '\0'); + allocate = (flags & SV_HAS_TRAILING_NUL) ? len : PERL_STRLEN_ROUNDUP(len + 1); #ifdef DEBUGGING