This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
hv_iternext can return NULL
authorJarkko Hietaniemi <jhi@iki.fi>
Thu, 22 Oct 2015 12:35:10 +0000 (08:35 -0400)
committerJarkko Hietaniemi <jhi@iki.fi>
Sat, 24 Oct 2015 00:55:58 +0000 (20:55 -0400)
Coverity #104801

cpan/Devel-PPPort/parts/inc/misc

index 1cf1e7e..aedad05 100644 (file)
@@ -521,7 +521,9 @@ check_HeUTF8(utf8_key)
                 hv_store(hash, key, klen, newSVpvs("string"), 0);
                 hv_iterinit(hash);
                 ent = hv_iternext(hash);
-                mXPUSHp((HeUTF8(ent) == 0 ? "norm" : "utf8"), 4);
+                if (ent) {
+                    mXPUSHp((HeUTF8(ent) == 0 ? "norm" : "utf8"), 4);
+                }
                 hv_undef(hash);