From fc0832ae99b13ce34ceb45f1125927a5d632288c Mon Sep 17 00:00:00 2001 From: terrafrost Date: Mon, 2 Mar 2020 10:18:30 -0600 Subject: [PATCH] ASN1: fix for malformed ASN1 strings --- phpseclib/File/ASN1.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/phpseclib/File/ASN1.php b/phpseclib/File/ASN1.php index 4bd355a1e..98fe4b83a 100644 --- a/phpseclib/File/ASN1.php +++ b/phpseclib/File/ASN1.php @@ -577,6 +577,10 @@ function _decode_ber($encoded, $start = 0, $encoded_pos = 0) */ function asn1map($decoded, $mapping, $special = array()) { + if (!is_array($decoded)) { + return false; + } + if (isset($mapping['explicit']) && is_array($decoded['content'])) { $decoded = $decoded['content'][0]; }