Update of /cvsroot/monetdb/pathfinder/runtime
In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv30721

Modified Files:
      Tag: Nov2009
        pf_support.mx 
Log Message:
Postpone dereference until after NULL check.
Found by Coverity.


Index: pf_support.mx
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/runtime/pf_support.mx,v
retrieving revision 1.336
retrieving revision 1.336.4.1
diff -u -d -r1.336 -r1.336.4.1
--- pf_support.mx       18 Jun 2009 10:52:00 -0000      1.336
+++ pf_support.mx       4 Dec 2009 15:06:31 -0000       1.336.4.1
@@ -6072,12 +6072,13 @@
 int CMDxquery_hash_bat(BAT **res, BAT* b) {
     BUN cnt = BATcount(b);
     BAT *bn = *res = BATnew(TYPE_void, TYPE_int, cnt);
-    int *dst = (int*) Tloc(bn, BUNfirst(bn));
+    int *dst;
     BUN p, q;
     BATiter bi;
 
     if (bn == NULL) return GDK_FAIL;
     bi = bat_iterator(b);
+    dst = (int*) Tloc(bn, BUNfirst(bn));
     BATloop(b,p,q) {
         str val = (str) BUNtvar(bi,p);
         XQUERY_HASH(dst, val);


------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to