diff -Nur kdegraphics-3.4.2.orig/kpdf/xpdf/xpdf/PDFDoc.cc kdegraphics-3.4.2/kpdf/xpdf/xpdf/PDFDoc.cc --- kdegraphics-3.4.2.orig/kpdf/xpdf/xpdf/PDFDoc.cc 2005-07-20 03:00:36.000000000 -0700 +++ kdegraphics-3.4.2/kpdf/xpdf/xpdf/PDFDoc.cc 2005-08-02 10:26:56.647106136 -0700 @@ -115,23 +115,19 @@ GBool PDFDoc::setup(GString *ownerPassword, GString *userPassword) { str->reset(); - char eof[8]; + char *eof = new char[1024]; int pos = str->getPos(); - str->setPos(7, -1); - eof[0] = str->getChar(); - eof[1] = str->getChar(); - eof[2] = str->getChar(); - eof[3] = str->getChar(); - eof[4] = str->getChar(); - eof[5] = str->getChar(); - eof[6] = str->getChar(); - eof[7] = '\0'; + str->setPos(1024, -1); + for (int i = 0; i < 1024; i++) eof[i] = str->getChar(); + eof[1024] = '\0' if (strstr(eof, "%%EOF") == NULL) { error(-1, "Document does not have ending %%EOF"); errCode = errDamaged; + delete[] eof; return gFalse; } + delete[] eof; str->setPos(pos);