Bugs item #2524288, was opened at 2009-01-20 10:17
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=462816&aid=2524288&group_id=51305

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: wxpdfdoc
Group: last released version
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Eric W Savage (ewsavage)
Assigned to: Nobody/Anonymous (nobody)
Summary: Problem with encrypted documents written by wxpdfdoc 

Initial Comment:
There is a problem with some encrypted PDF documents written by wxpdfdoc.

If a PDF document is written after using the SetProtection method with a empty 
user password and non-empty owner password, then a small percentage of 
documents require an open password from Adobe Reader to read the document.

I took a look through the code and it looks to be an invalid document id 
written into the trailer section of the PDF. The document id is invalid if it 
contains a NULL character anywhere before the end of the string. If the 
document id contains any NULL characters, then the document id is chopped at 
that point. The chopping is a result of using strcpy.

I am using the non UNICODE version of the tool and AES encryption with 128 bits.

The offending code is located in the method:
wxPdfDocument::OutHexTextstring
within the file
src/pdfkernel.cpp around line 2083.

2083: #else
2084:   strcpy(&mbstr[ofs],s.c_str());
2085: #endif

should probably be:

2083: #else
2084:   memcpy(&mbstr[ofs],s.c_str(), len);
2085: #endi





----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=462816&aid=2524288&group_id=51305

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
wxCode-users mailing list
wxCode-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxcode-users

Reply via email to