Update of /cvsroot/monetdb/sql/src/common
In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv17506

Modified Files:
      Tag: Nov2009
        sql_list.mx 
Log Message:
The lists don't change size half way through the function.
Found by Coverity.


Index: sql_list.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/common/sql_list.mx,v
retrieving revision 1.21.2.2
retrieving revision 1.21.2.3
diff -u -d -r1.21.2.2 -r1.21.2.3
--- sql_list.mx 20 Nov 2009 13:06:35 -0000      1.21.2.2
+++ sql_list.mx 23 Dec 2009 09:27:33 -0000      1.21.2.3
@@ -269,8 +269,8 @@
        /* sort descending */
        GDKqsort_rev(keys, pos, NULL, cnt, sizeof(int), sizeof(int), TYPE_int);
        for(j=0; j<cnt; j++) {
-               for(n = l->h, i = 0; n && i != pos[j]; n = n->next, i++) 
-                       ;
+               for(n = l->h, i = 0; i != pos[j]; n = n->next, i++) 
+                       assert(n);
                list_append(res, dup(n->data));
        }
        return res;
@@ -292,8 +292,8 @@
        /* sort descending */
        GDKqsort_rev(keys, pos, NULL, cnt, sizeof(int), sizeof(int), TYPE_int);
        for(j=0; j<cnt; j++) {
-               for(n = l->h, i = 0; n && i != pos[j]; n = n->next, i++) 
-                       ;
+               for(n = l->h, i = 0; i != pos[j]; n = n->next, i++) 
+                       assert(n);
                list_append(res, dup(n->data));
        }
        return res;


------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins

Reply via email to