[Libreoffice-commits] core.git: Blind fix to TBs

julien2412 serval2412 at yahoo.fr
Mon Oct 24 08:39:52 UTC 2016


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.


More information about the LibreOffice mailing list