lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 7c6bdc6 1/2: Fix defect introduced 20170116T1


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 7c6bdc6 1/2: Fix defect introduced 20170116T1522Z: segfault
Date: Wed, 8 Mar 2017 13:36:33 -0500 (EST)

branch: master
commit 7c6bdc6b37618be6ffae8e001d92f5bc4fc93d51
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Fix defect introduced 20170116T1522Z: segfault
    
    Reproducible segfault upon generating a group quote PDF with a default
    census. See the thread beginning here:
      http://lists.nongnu.org/archive/html/lmi/2017-03/msg00046.html
---
 group_quote_pdf_gen_wx.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/group_quote_pdf_gen_wx.cpp b/group_quote_pdf_gen_wx.cpp
index 6f9d080..99ab3b3 100644
--- a/group_quote_pdf_gen_wx.cpp
+++ b/group_quote_pdf_gen_wx.cpp
@@ -1229,7 +1229,10 @@ void group_quote_pdf_generator_wx::output_document_header
     std::vector<extra_summary_field> const& f = report_data_.extra_fields_;
     fields.insert(fields.end(), f.begin(), f.end());
 
-    for(auto i = fields.begin(); i != fields.end(); ++i)
+    // TRICKY !! This for-statement deliberately does not increment
+    // 'i' at the top. Instead, 'i' is incremented in the body of the
+    // subordinate for-statement that iterates across 'col'.
+    for(auto i = fields.begin(); i != fields.end();)
         {
         // Start a new table row and ensure it will be closed.
         open_and_ensure_closing_tag tag_tr(summary_html, "tr");



reply via email to

[Prev in Thread] Current Thread [Next in Thread]