[poppler] poppler/Decrypt.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Sat Oct 23 14:56:10 PDT 2010


 poppler/Decrypt.cc |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit c46e863b7b94dc2f83a7d89f4afb8fe3bc8ec35c
Author: Albert Astals Cid <aacid at kde.org>
Date:   Sat Oct 23 22:55:49 2010 +0100

    Do not divide by 0 in rc4InitKey

diff --git a/poppler/Decrypt.cc b/poppler/Decrypt.cc
index abca820..bcba767 100644
--- a/poppler/Decrypt.cc
+++ b/poppler/Decrypt.cc
@@ -352,6 +352,10 @@ static void rc4InitKey(Guchar *key, int keyLen, Guchar *state) {
 
   for (i = 0; i < 256; ++i)
     state[i] = i;
+
+  if (keyLen == 0)
+    return;
+
   index1 = index2 = 0;
   for (i = 0; i < 256; ++i) {
     index2 = (key[index1] + state[i] + index2) % 256;


More information about the poppler mailing list