Merge pull request #1325 from madrang/CryptoToolsCtorCheck
authorMiguel de Icaza <miguel@gnome.org>
Wed, 23 Sep 2015 20:06:59 +0000 (16:06 -0400)
committerMiguel de Icaza <miguel@gnome.org>
Wed, 23 Sep 2015 20:06:59 +0000 (16:06 -0400)
Added null check in constructor of BlockProcessor in CryptoTools.

mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoTools.cs

index d57ce5ae55c1e69d7a444b3568960b11554979be..054038731aec8a6f15ef7c9ece468b1603ae68b9 100644 (file)
@@ -88,6 +88,10 @@ namespace Mono.Security.Cryptography {
                // block size (which isn't their real internal block size)
                public BlockProcessor (ICryptoTransform transform, int blockSize)
                {
+                       if (transform == null)
+                               throw new ArgumentNullException ("transform");
+                       if (blockSize <= 0)
+                               throw new ArgumentOutOfRangeException ("blockSize");
                        this.transform = transform;
                        this.blockSize = blockSize;
                        block = new byte [blockSize];