Revision: 48513
          http://brlcad.svn.sourceforge.net/brlcad/?rev=48513&view=rev
Author:   erikgreenwald
Date:     2012-01-12 16:18:48 +0000 (Thu, 12 Jan 2012)
Log Message:
-----------
test lenbuf after fread to verify an actual number is there before decoding the 
length. Cov1459

Modified Paths:
--------------
    brlcad/trunk/src/librt/db5_io.c

Modified: brlcad/trunk/src/librt/db5_io.c
===================================================================
--- brlcad/trunk/src/librt/db5_io.c     2012-01-12 16:16:51 UTC (rev 48512)
+++ brlcad/trunk/src/librt/db5_io.c     2012-01-12 16:18:48 UTC (rev 48513)
@@ -383,6 +383,10 @@
        bu_log("db5_get_raw_internal_fp(): fread lenbuf error\n");
        return -2;
     }
+    if (isdigit(*lenbuf) == 0) {
+       bu_log("db5_get_raw_internal_fp(): lenbuf is bad value: \"%s\"\n", 
lenbuf);
+       return -2;
+    }
     used += db5_decode_length(&rip->object_length, lenbuf, 
rip->h_object_width);
     rip->object_length <<= 3;  /* cvt 8-byte chunks to byte count */
 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
RSA(R) Conference 2012
Mar 27 - Feb 2
Save $400 by Jan. 27
Register now!
http://p.sf.net/sfu/rsa-sfdev2dev2
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to