Review Request 127770: Increase maximum string length in KSycoca database

Jos van den Oever jos at vandenoever.info
Wed Apr 27 20:00:50 UTC 2016


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/127770/
-----------------------------------------------------------

Review request for KDE Frameworks and David Faure.


Repository: kservice


Description
-------

The code for reading and writing of strings in KSycoca is not symmetrical. Strings of any length can be written, but only strings of less than 8192 bytes may be read. This limit is set in KSycocaUtilsPrivate::read. The limit is probably there to avoid out-of-memory situations.

On my system I have a lot of XDG data dirs. The length of the environment variable is currently 4092 bytes. KSycocaBuild saves that as UTF-16 which needs 8184 bytes. KBuildSycoca save that without complaint but complains when reading it.


The simplest solution here is to simply increase the magic number 8192 to e.g. 65528. This is just a temporary buffer.

Or we just check the size of the whole cache file (e.g. < 100M) and remove all other limits. That would simplify

   KSycocaUtilsPrivate::read(*str, header.prefixes);

to

   *str >> header.prefixes;

This patch chooses the first option.


Diffs
-----

  src/sycoca/ksycocautils.cpp 1ba75e8 

Diff: https://git.reviewboard.kde.org/r/127770/diff/


Testing
-------

Ran unit tests on KService. All but one of the previously failing tests on NixOS is now fixed.


Thanks,

Jos van den Oever

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20160427/dc7acd42/attachment.html>


More information about the Kde-frameworks-devel mailing list