]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - pdftops/Decrypt.cxx
Load cups into easysw/current.
[thirdparty/cups.git] / pdftops / Decrypt.cxx
index bbe1d34a53b7c944116cb44ed820fa042eddadbd..88b62056d20b825fbb63174959a094d10a5f598f 100644 (file)
@@ -140,6 +140,12 @@ GBool Decrypt::makeFileKey2(int encVersion, int encRevision, int keyLength,
   int len, i, j;
   GBool ok;
 
+
+  // check whether we have non-zero keyLength
+  if ( keyLength < 5 || keyLength > 16 ) {
+    return gFalse;
+  }
+
   // generate file key
   buf = (Guchar *)gmalloc(72 + fileID->getLength());
   if (userPassword) {