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-Tag: accepted/trunk/20130322.191538~17928 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2e90b4cd9b8959c8a9cede0cb14ef5338ec93d49;p=platform%2Fupstream%2Fperl.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