Date: prev next · Thread: first prev next last
2016 Archives by date, by thread · List index


sberg wrote
On 10/23/2016 05:21 PM, Julien Nabet wrote:
commit f736c71dde8f4a84688b932b1531808d4c7cbd8c
Author: Julien Nabet <

serval2412@

>
Date:   Sun Oct 23 16:12:43 2016 +0200

    Blind fix to TBs

    Change-Id: I74165378255e3c844ee7f91a5d4eb09a573784bd
    Reviewed-on: https://gerrit.libreoffice.org/30179
    Reviewed-by: Julien Nabet <

serval2412@

>
    Tested-by: Julien Nabet <

serval2412@

>

diff --git a/xmlsecurity/source/pdfio/pdfdocument.cxx
b/xmlsecurity/source/pdfio/pdfdocument.cxx
index 6543734..753c308 100644
--- a/xmlsecurity/source/pdfio/pdfdocument.cxx
+++ b/xmlsecurity/source/pdfio/pdfdocument.cxx
@@ -775,7 +775,7 @@ size_t PDFDocument::FindStartXRef(SvStream& rStream)
     // Find the "startxref" token, somewhere near the end of the
document.
     std::vector
<char>
 aBuf(1024);
     rStream.Seek(STREAM_SEEK_TO_END);
-    rStream.SeekRel(-1 * aBuf.size());
+    rStream.SeekRel(-1 * aBuf.capacity());

What problem does this attempt to fix?

The changed code looks rather broken to me:  After construction, aBuf is 
guaranteed to have a size of 1024, while I think the standard doesn't 
make a guarantee on its exact capacity.

Hi,

I thought there was just some allocation of 1024 but size would stay at 0,
that's why I tried with capacity.

I can revert the patch if you want.

Julien



--
View this message in context: 
http://nabble.documentfoundation.org/Re-Libreoffice-commits-core-git-Blind-fix-to-TBs-tp4198073p4198074.html
Sent from the Dev mailing list archive at Nabble.com.

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.