diff options
author | Gisle Aas <gisle@activestate.com> | 2006-01-10 08:58:21 +0000 |
---|---|---|
committer | Gisle Aas <gisle@activestate.com> | 2006-01-10 08:58:21 +0000 |
commit | 2d2af554da24863760d055834f4984fbca7ec85b (patch) | |
tree | 99ca4a308dba0bbab27f7e2b008e3a91dcbe8fc1 /perl.c | |
parent | 11e2783cff6b99a1463ba0eb8e30a005fc688aaf (diff) | |
download | perl-2d2af554da24863760d055834f4984fbca7ec85b.tar.gz |
Avoid possible dereference of NULL in the initialization of PL_origalen.
This can only happen when perlparse is called with no argv.
Don't try to update PL_origargv unless PL_origalen is at least 2.
p4raw-id: //depot/perl@26760
Diffstat (limited to 'perl.c')
-rw-r--r-- | perl.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1487,7 +1487,7 @@ setuid perl scripts securely.\n"); } } /* Can we grab env area too to be used as the area for $0? */ - if (PL_origenviron) { + if (s && PL_origenviron) { if ((PL_origenviron[0] == s + 1 #ifdef OS2 || (PL_origenviron[0] == s + 9 && (s += 8)) @@ -1523,7 +1523,7 @@ setuid perl scripts securely.\n"); } } } - PL_origalen = s - PL_origargv[0] + 1; + PL_origalen = s ? s - PL_origargv[0] + 1 : 0; } if (PL_do_undump) { |