Closed GoogleCodeExporter closed 9 years ago
Original comment by jam@chromium.org
on 28 May 2014 at 6:02
Original comment by bo...@foxitsoftware.com
on 2 Jun 2014 at 11:05
Original comment by bo...@foxitsoftware.com
on 2 Jun 2014 at 11:06
This is caused by trailing '\0' in url and affecting other pdf with text link.
Should change pdfium_page.cc, line 410 to
for (size_t j = 0; j < link.url.length()-1; ++j)
John, please confirm and commit this, thanks!
Original comment by bo...@foxitsoftware.com
on 3 Jun 2014 at 7:29
ah, this is a regression. sample files that I have used to work, but not
anymore. It looks like we're adding the null terminator when we create a string
from the result of FPDFLink_GetURL, which per documentation it doesn't include.
Not sure how this worked before.
Original comment by jam@chromium.org
on 5 Jun 2014 at 6:06
Bo: I looked into this more, and I believe the problem is in fpdftext.cpp.
FPDFLink_GetURL says it returns the number of chracters excluding the
terminator. However the implementation converts from a CFX_WideString (with
length not including terminating null) to a CFX_ByteString. That conversion
adds a null terminator to the length, since CFX_WideString::UTF16LE_Encode has
a default parameter of bTerminate=true.
Original comment by jam@chromium.org
on 6 Jun 2014 at 1:39
John, the comments for FPDFLink_GetURL says "If buffer is NULL or buflen is
zero, return number of characters (not bytes and an additional terminator is
also counted) needed", so in pdfium_page.cc:390, 394, the url_length should
already include the terminator.
Going down, pdfium_page.cc:410 link.url.length() also includes the terminator.
In this regard, fpdftext.cpp should be ok.
Original comment by bo...@foxitsoftware.com
on 6 Jun 2014 at 2:19
Hi Bo, I was going by
http://tickets.foxitsoftware.com/support/usermanuals/DLL311/group___f_p_d_f_t_e_
x_t.html#ga250c31057dcc3277e9f56e870e690c58. I guess that's outdated since it
doesn't mention that? I now see that the header in pdfium's repo says
otherwise, so I'll go with that instead.
Original comment by jam@chromium.org
on 6 Jun 2014 at 3:01
That document is indeed outdated, thanks for pointing out.
Original comment by bo...@foxitsoftware.com
on 6 Jun 2014 at 4:22
Original comment by jam@chromium.org
on 6 Jun 2014 at 2:42
Original issue reported on code.google.com by
jem...@feralinteractive.com
on 28 May 2014 at 11:49Attachments: