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


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.

Julien.
diff --git a/sal/qa/osl/process/osl_process.cxx b/sal/qa/osl/process/osl_process.cxx
index 2535c4c..e5f53c7 100644
--- a/sal/qa/osl/process/osl_process.cxx
+++ b/sal/qa/osl/process/osl_process.cxx
@@ -60,6 +60,7 @@
 #include <algorithm>
 #include <iterator>
 #include <string>
+#include <limits>
 
 #ifdef UNX
 #if defined( MACOSX )
@@ -469,7 +470,7 @@ public:
         OString temp_file_name = OUStringToOString(OUString(
             parameters_[1]), osl_getThreadTextEncoding());
         std::ifstream file(temp_file_name.getStr());
-
+        file.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
         CPPUNIT_ASSERT_MESSAGE
         (
             "I/O error, cannot open child environment file",
@@ -561,8 +562,13 @@ public:
 #endif
 
         bool different_env_size_equals    = (different_child_env_vars.size() == 
different_env_vars.size());
-        bool different_env_content_equals =
+        fprintf(stderr, "different_child_env_vars.size() %d\n", 
different_child_env_vars.size());fflush(stderr);
+        fprintf(stderr, "different_env_vars.size() %d\n", 
different_env_vars.size());fflush(stderr);
+        bool different_env_content_equals = false;
+        if (different_child_env_vars.size() == different_env_vars.size()) {
+            different_env_content_equals =
             std::equal(different_env_vars.begin(), different_env_vars.end(), 
different_child_env_vars.begin());
+        }
 
         return (common_env_size_equals && common_env_content_equals &&
                 different_env_size_equals && different_env_content_equals);

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.