diff options
author | josh <twists@gmail.com> | 2007-10-14 14:37:08 -0700 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2007-10-17 08:17:29 +0000 |
commit | 1e1d4b91957a9f66bbb14b2c7f1bbf88c1f89cdf (patch) | |
tree | ab06c1b94ecf038d0bb7b80ad7e53a8ece4b28a3 /regcomp.c | |
parent | a5a709ec819bfe84b1af6f781d5d87ef68e00c3a (diff) | |
download | perl-1e1d4b91957a9f66bbb14b2c7f1bbf88c1f89cdf.tar.gz |
Fix a few segfaults and a when() bug
From: "josh" <twists@gmail.com>
Message-ID: <20071015043708.GA10981@grenekatz.org>
p4raw-id: //depot/perl@32120
Diffstat (limited to 'regcomp.c')
-rw-r--r-- | regcomp.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -4944,9 +4944,13 @@ Perl_reg_named_buff_exists(pTHX_ REGEXP * const rx, SV * const key, SV* Perl_reg_named_buff_firstkey(pTHX_ REGEXP * const rx, const U32 flags) { - (void)hv_iterinit(rx->paren_names); + if ( rx && rx->paren_names ) { + (void)hv_iterinit(rx->paren_names); - return CALLREG_NAMED_BUFF_NEXTKEY(rx, NULL, flags & ~RXapif_FIRSTKEY); + return CALLREG_NAMED_BUFF_NEXTKEY(rx, NULL, flags & ~RXapif_FIRSTKEY); + } else { + return FALSE; + } } SV* |