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

Modified Files:
      Tag: Nov2009
        milprint_summer.c 
Log Message:
The first buf == NULL check is to help Coverity.
The second is to defend against failing malloc.


Index: milprint_summer.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/mil/milprint_summer.c,v
retrieving revision 1.433.6.1
retrieving revision 1.433.6.2
diff -u -d -r1.433.6.1 -r1.433.6.2
--- milprint_summer.c   7 Jan 2010 15:17:42 -0000       1.433.6.1
+++ milprint_summer.c   12 Jan 2010 09:04:46 -0000      1.433.6.2
@@ -11262,9 +11262,11 @@
             /* get the type name, and assure there *is* a namespace */
             char *tpe = PFty_str(TY(LR(args)));
             char *nme;
-            if (maxbufsize < strlen(tpe) + 4) {
+            if (buf == NULL || maxbufsize < strlen(tpe) + 4) {
                 maxbufsize = strlen(tpe) + 4;
                 buf = buf ? realloc(buf, maxbufsize) : malloc(maxbufsize);
+                if (buf == NULL)
+                    PFoops(OOPS_OUTOFMEM, "can't get requested memory.");
             }
             nme = buf;
             if (strchr(tpe, ':') == NULL)  {


------------------------------------------------------------------------------
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-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to