This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
S_glob_2inpuv() did not check if lenp was NULL. Oops.
authorNicholas Clark <nick@ccl4.org>
Fri, 14 Apr 2006 16:43:03 +0000 (16:43 +0000)
committerNicholas Clark <nick@ccl4.org>
Fri, 14 Apr 2006 16:43:03 +0000 (16:43 +0000)
p4raw-id: //depot/perl@27803

sv.c

diff --git a/sv.c b/sv.c
index 3f44139..a64b272 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -1738,7 +1738,11 @@ S_glob_2inpuv(pTHX_ GV *gv, STRLEN *len, bool want_number)
           can tail call us and return true.  */
        return (char *) 1;
     } else {
-       return SvPV(buffer, *len);
+       assert(SvPOK(buffer));
+       if (len) {
+           *len = SvCUR(buffer);
+       }
+       return SvPVX(buffer);
     }
 }