Change 20097 by [EMAIL PROTECTED] on 2003/07/09 17:27:35
Fix for the 'print v65' plus safety tweaks from Rafael.
Affected files ...
... //depot/perl/toke.c#477 edit
Differences ...
==== //depot/perl/toke.c#477 (text) ====
Index: perl/toke.c
--- perl/toke.c#476~20084~ Tue Jul 8 23:58:39 2003
+++ perl/toke.c Wed Jul 9 10:27:35 2003
@@ -7978,15 +7978,14 @@
char *pos = s;
char *start = s;
if (*pos == 'v') pos++; /* get past 'v' */
- while (isDIGIT(*pos) || *pos == '_')
- pos++;
+ while (pos < PL_bufend && (isDIGIT(*pos) || *pos == '_'))
+ pos++;
if ( *pos != '.') {
/* this may not be a v-string if followed by => */
start = pos;
- if (isSPACE(*start))
- start = skipspace(start);
- if ( *start == '=' && start[1] == '>' )
- {
+ while (start < PL_bufend && isSPACE(*start))
+ ++start;
+ if ((PL_bufend - start) >= 2 && *start == '=' && start[1] == '>' ) {
/* return string not v-string */
sv_setpvn(sv,(char *)s,pos-s);
return pos;
@@ -8029,13 +8028,13 @@
sv_catpvn(sv, (const char*)tmpbuf, tmpend - tmpbuf);
if (!UNI_IS_INVARIANT(NATIVE_TO_UNI(rev)))
SvUTF8_on(sv);
- if (*pos == '.' && isDIGIT(pos[1]))
+ if (pos + 1 < PL_bufend && *pos == '.' && isDIGIT(pos[1]))
s = ++pos;
else {
s = pos;
break;
}
- while (isDIGIT(*pos) || *pos == '_')
+ while (pos < PL_bufend && (isDIGIT(*pos) || *pos == '_'))
pos++;
}
SvPOK_on(sv);
End of Patch.