Update of /cvsroot/monetdb/sql/src/backends/monet5
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv19311/src/backends/monet5

Modified Files:
        sql_result.mx 
Log Message:
propagated changes of Tuesday Nov 10 2009 - Wednesday Nov 11 2009
from the Nov2009 branch to the development trunk

  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2009/11/10 - stmane: src/backends/monet5/sql_result.mx,1.127.2.6
  
  (re-)address more Coverity-discovered potential NULL-dereferences:
  return an error (-1) in case BATdescriptor() returns NULL
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Index: sql_result.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/sql_result.mx,v
retrieving revision 1.130
retrieving revision 1.131
diff -u -d -r1.130 -r1.131
--- sql_result.mx       10 Nov 2009 18:27:35 -0000      1.130
+++ sql_result.mx       11 Nov 2009 09:31:52 -0000      1.131
@@ -1067,6 +1067,8 @@
        if (only_header) {
                if (t->order) {
                        order = BATdescriptor(t->order);
+                       if (!order)
+                               return -1;
 
                        count = BATcount(order);
                } else
@@ -1155,6 +1157,8 @@
                res = mvc_export_row(m, s, t, "", t->tsep, t->rsep, t->ssep, 
t->ns);
        } else {
                order = BATdescriptor(t->order);
+               if (!order)
+                       return -1;
                count = BATcount(order);
 
                res = mvc_export_table(m, s, t, order, 0, count, "", t->tsep, 
t->rsep, t->ssep, t->ns);
@@ -1185,6 +1189,8 @@
        if (!t->order)
                return mvc_export_row(m, s, t, "[ ", ",\t", "\t]\n", "\"", 
"NULL");
        order = BATdescriptor(t->order);
+       if (!order)
+               return -1;
 
        count = m->reply_size;
        if (count == 0 || count >= BATcount(order)) {
@@ -1228,6 +1234,8 @@
                return export_error(order);
 
        order = BATdescriptor(t->order);
+       if (!order)
+               return -1;
        cnt = nr;
        if (cnt == 0) 
                cnt = BATcount(order);


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins

Reply via email to