diff options
author | Ian Phillipps <Ian.Phillipps@iname.com> | 1999-07-22 23:48:59 +0100 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-07-26 04:48:35 +0000 |
commit | 4802d5d799ab971f97d7df94b7f1637c213350a8 (patch) | |
tree | 81d27d9036f21f7750a25617fa7234225c51db13 /sv.c | |
parent | d1e3b762d0953dc1b5342362e83e75454a3e2dd5 (diff) | |
download | perl-4802d5d799ab971f97d7df94b7f1637c213350a8.tar.gz |
make reset() behave with high-bit characters
Message-ID: <19990722224859.A27987@homer.diplex.co.uk>
Subject: [PATCH 5.005_57] sv_reset can cause stack corruption
p4raw-id: //depot/perl@3758
Diffstat (limited to 'sv.c')
-rw-r--r-- | sv.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -4014,7 +4014,7 @@ Perl_sv_reset(pTHX_ register char *s, HV *stash) register I32 i; register PMOP *pm; register I32 max; - char todo[256]; + char todo[PERL_UCHAR_MAX+1]; if (!stash) return; @@ -4033,11 +4033,11 @@ Perl_sv_reset(pTHX_ register char *s, HV *stash) Zero(todo, 256, char); while (*s) { - i = *s; + i = (unsigned char)*s; if (s[1] == '-') { s += 2; } - max = *s++; + max = (unsigned char)*s++; for ( ; i <= max; i++) { todo[i] = 1; } |