--- cups-1.2rc3/pdftops/Decrypt.cxx.CAN-2005-0064	2005-09-17 15:52:15.000000000 +0100
+++ cups-1.2rc3/pdftops/Decrypt.cxx	2006-04-26 18:14:58.000000000 +0100
@@ -140,6 +140,11 @@
   int len, i, j;
   GBool ok;
 
+  // check whether we have non-zero keyLength
+  if ( !keyLength || keyLength > 16 ) {
+    return gFalse;
+  }
+ 
   // generate file key
   buf = (Guchar *)gmalloc(72 + fileID->getLength());
   if (userPassword) {
