Revision: 50699
          http://brlcad.svn.sourceforge.net/brlcad/?rev=50699&view=rev
Author:   brlcad
Date:     2012-05-26 14:25:26 +0000 (Sat, 26 May 2012)
Log Message:
-----------
there's not bu_strcpy() but there is bu_strlcpy().  using strcpy() will cause 
regression testing to fail due to HACKING restrictions on using unsafe libc 
functions.

Modified Paths:
--------------
    brlcad/trunk/src/libbu/test_bitv.c

Modified: brlcad/trunk/src/libbu/test_bitv.c
===================================================================
--- brlcad/trunk/src/libbu/test_bitv.c  2012-05-26 14:17:42 UTC (rev 50698)
+++ brlcad/trunk/src/libbu/test_bitv.c  2012-05-26 14:25:26 UTC (rev 50699)
@@ -79,8 +79,13 @@
 
     a = bu_vls_vlsinit();
     res_bitv = bu_bitv_new(length);
-    strcpy((char*)res_bitv->bits, inp);
 
+    /* accessing the bits array directly as a char* is not safe since
+     * there's no bounds checking and assumes implementation is
+     * contiguous memory.
+     */
+    bu_strlcpy((char*)res_bitv->bits, inp, length/8);
+
     bu_bitv_to_hex(a, res_bitv);
 
     if (!bu_strcmp(a->vls_str, res)) {

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


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to