diff --git a/System/Certificate/X509/Win32.hs b/System/Certificate/X509/Win32.hs
--- a/System/Certificate/X509/Win32.hs
+++ b/System/Certificate/X509/Win32.hs
@@ -32,7 +32,7 @@
 fromBlob mem ty
 	| ty == rEG_BINARY = do
 		len <- B.c_strlen (castPtr mem)
-		B.create (fromIntegral len) (\bptr -> B.memcpy bptr mem len)
+		B.create (fromIntegral len) (\bptr -> B.memcpy bptr mem (fromIntegral len))
 	| otherwise        = error "certificate blob have unexpected type"
 
 getSystemPath :: IO FilePath
diff --git a/certificate.cabal b/certificate.cabal
--- a/certificate.cabal
+++ b/certificate.cabal
@@ -1,5 +1,5 @@
 Name:                certificate
-Version:             1.2.8
+Version:             1.2.9
 Description:
     Certificates and Key reader/writer
     .
