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


Le 29/06/2011 08:44, Julien Nabet a écrit :
Hello,

I tried the patch attached. In fact, I remarked by reading some forums (sorry i don't remember the specific link I read) that getline could need some extra precaution. I don't know if this patch is correct but there's no more memory error. However there's now an assertion failure because number of env vars is different from number children env vars.
Sorry, in my previous message the call of the function "ignore" was hiding the problem.

However I found that if I apply this patch, it works :
diff --git a/sal/qa/osl/process/osl_process.cxx b/sal/qa/osl/process/osl_process.cxx
index 2535c4c..8695d79 100644
--- a/sal/qa/osl/process/osl_process.cxx
+++ b/sal/qa/osl/process/osl_process.cxx
@@ -477,6 +477,7 @@ public:
         );

         std::string line;
+       line.reserve(10000);
         while (std::getline(file, line, '\0'))
             env_container->push_back(line);
         tidy_container(*env_container);

(I haven't search about adjusting reserve)

Julien.

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.