From 12df1dcdfd077a0ade29cb0f188a17c5095539ea Mon Sep 17 00:00:00 2001 From: morkt Date: Tue, 9 Sep 2014 01:04:27 +0400 Subject: [PATCH] (GetScheme): fixed potential bug when looking up unknown encryption scheme. --- ArcFormats/ArcXP3.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ArcFormats/ArcXP3.cs b/ArcFormats/ArcXP3.cs index 1220ce77..f636470e 100644 --- a/ArcFormats/ArcXP3.cs +++ b/ArcFormats/ArcXP3.cs @@ -290,11 +290,9 @@ NextEntry: public static ICrypt GetScheme (string scheme) { - ICrypt algorithm = NoCryptAlgorithm; - if (!string.IsNullOrEmpty (scheme)) - { - KnownSchemes.TryGetValue (scheme, out algorithm); - } + ICrypt algorithm; + if (string.IsNullOrEmpty (scheme) || !KnownSchemes.TryGetValue (scheme, out algorithm)) + algorithm = NoCryptAlgorithm; return algorithm; }