poppler/Decrypt.cc | 4 ++++ poppler/Function.cc | 3 +++ 2 files changed, 7 insertions(+)
New commits: commit 86014500b3e8361b21968fc2caaa4ad7858d157c Author: Albert Astals Cid <[email protected]> Date: Sat Oct 23 23:00:03 2010 +0100 Do not crash if n is 0 diff --git a/poppler/Function.cc b/poppler/Function.cc index e7383fd..409b679 100644 --- a/poppler/Function.cc +++ b/poppler/Function.cc @@ -995,6 +995,9 @@ void PSStack::roll(int n, int j) { PSObject obj; int i, k; + if (unlikely(n == 0)) { + return; + } if (j >= 0) { j %= n; } else { commit c081ad0609cc27f7b917dd73411263f8d583d4ac Author: Albert Astals Cid <[email protected]> Date: Sat Oct 23 22:59:50 2010 +0100 add unlikely marker diff --git a/poppler/Decrypt.cc b/poppler/Decrypt.cc index bcba767..2373a66 100644 --- a/poppler/Decrypt.cc +++ b/poppler/Decrypt.cc @@ -353,7 +353,7 @@ static void rc4InitKey(Guchar *key, int keyLen, Guchar *state) { for (i = 0; i < 256; ++i) state[i] = i; - if (keyLen == 0) + if (unlikely(keyLen == 0)) return; index1 = index2 = 0; commit 72ed1b206c2ca3640dbc76a7852b9208df688fe9 Author: Albert Astals Cid <[email protected]> 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; _______________________________________________ poppler mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/poppler
