Revision: 48471
http://brlcad.svn.sourceforge.net/brlcad/?rev=48471&view=rev
Author: brlcad
Date: 2012-01-12 01:21:30 +0000 (Thu, 12 Jan 2012)
Log Message:
-----------
fix for an off-by-one strncpy() error reported by coverity via OVERRUN_STATIC
check. my own bad even after numerous terrible refactorings. it was writing
one byte too many after the fbuf format buffer for long format strings. few
more iterations and might get it right eventually. (cid 1747)
Modified Paths:
--------------
brlcad/trunk/src/libbu/vls.c
Modified: brlcad/trunk/src/libbu/vls.c
===================================================================
--- brlcad/trunk/src/libbu/vls.c 2012-01-12 01:19:39 UTC (rev 48470)
+++ brlcad/trunk/src/libbu/vls.c 2012-01-12 01:21:30 UTC (rev 48471)
@@ -745,8 +745,8 @@
/* Copy off the format string */
len = ep-sp+1;
- if ((size_t)len > sizeof(fbuf))
- len = sizeof(fbuf);
+ if ((size_t)len > sizeof(fbuf)-1)
+ len = sizeof(fbuf)-1;
/* intentionally avoid bu_strlcpy here since the source field
* may be legitimately truncated. FIXME: verify that claim.
*/
@@ -775,7 +775,8 @@
|| *fp == '+'
|| *fp == '.'
|| *fp == '-'
- || *fp == '*') {
+ || *fp == '*')
+ {
continue;
}
if (*fp == 'z') {
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