avoid coredump on C<printf "%vd">
Gurusamy Sarathy [Tue, 7 Mar 2000 10:58:17 +0000 (10:58 +0000)]
p4raw-id: //depot/perl@5596

sv.c

diff --git a/sv.c b/sv.c
index 8a86a92..f062bbb 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -5809,6 +5809,8 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV
                    vecsv = va_arg(*args, SV*);
                else if (svix < svmax)
                    vecsv = svargs[svix++];
+               else
+                   continue;
                dotstr = SvPVx(vecsv,dotstrlen);
                if (DO_UTF8(vecsv))
                    is_utf = TRUE;
@@ -5821,6 +5823,11 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV
                    vecsv = va_arg(*args, SV*);
                else if (svix < svmax)
                    vecsv = svargs[svix++];
+               else {
+                   vecstr = "";
+                   veclen = 0;
+                   continue;
+               }
                vecstr = (U8*)SvPVx(vecsv,veclen);
                utf = DO_UTF8(vecsv);
                continue;