The branch, 2.0.x, has been updated.

- Log -----------------------------------------------------------------

commit b835e6e03b30b5fb125680587fe580af244b66d5
Author: Uwe Stöhr <uwesto...@lyx.org>
Date:   Sat Jun 23 01:13:43 2012 +0200

    tex2lyx/table.cpp: fix bug #8204 also for branch (prevent crash if TeX 
files define wrong table column numbers)

diff --git a/src/tex2lyx/table.cpp b/src/tex2lyx/table.cpp
index 588d10c..9884513 100644
--- a/src/tex2lyx/table.cpp
+++ b/src/tex2lyx/table.cpp
@@ -1156,8 +1156,20 @@ void handle_tabular(Parser & p, ostream & os, string 
const & name,
                                cellinfo[row][col].content += os.str();
 
                                // add dummy cells for multicol
-                               for (size_t i = 0; i < ncells - 1 && col < 
colinfo.size(); ++i) {
+                               for (size_t i = 0; i < ncells - 1; ++i) {
                                        ++col;
+                                       if (col >= colinfo.size()) {
+                                               cerr << "The cell '"
+                                                       << cells[cell]
+                                                       << "' specifies "
+                                                       << 
convert<string>(ncells)
+                                                       << " columns while the 
table has only "
+                                                       << 
convert<string>(colinfo.size())
+                                                       << " columns!"
+                                                       << " Therefore the 
surplus columns will be ignored."
+                                                       << endl;
+                                               break;
+                                       }
                                        cellinfo[row][col].multi = 
CELL_PART_OF_MULTICOLUMN;
                                        cellinfo[row][col].align = 'c';
                                }
diff --git a/status.20x b/status.20x
index 2d024fa..945c2b6 100644
--- a/status.20x
+++ b/status.20x
@@ -276,6 +276,8 @@ What's new
 
 - Fix missing backslash in import of \def ... \csname ... \endcsname (bug 
8116).
 
+- Fix crash if TeX-files contain table logic bugs (bug 8204).
+
 
 * ADVANCED FIND AND REPLACE
 

-----------------------------------------------------------------------

Summary of changes:
 src/tex2lyx/table.cpp |   14 +++++++++++++-
 status.20x            |    2 ++
 2 files changed, 15 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
The LyX Source Repository

Reply via email to