Author: wyoung
Date: Fri Mar 3 13:42:29 2006
New Revision: 1207
URL: http://svn.gna.org/viewcvs/mysqlpp?rev=1207&view=rev
Log:
Changed a use of strcpy() to strncpy(), and forced the addition of a
trailing null.
Modified:
branches/v2.1-bakefile/lib/query.cpp
Modified: branches/v2.1-bakefile/lib/query.cpp
URL:
http://svn.gna.org/viewcvs/mysqlpp/branches/v2.1-bakefile/lib/query.cpp?rev=1207&r1=1206&r2=1207&view=diff
==============================================================================
--- branches/v2.1-bakefile/lib/query.cpp (original)
+++ branches/v2.1-bakefile/lib/query.cpp Fri Mar 3 13:42:29 2006
@@ -294,7 +294,8 @@
*this << std::ends;
size_t length = sbuffer_.str().size();
char* s = new char[length + 1];
- strcpy(s, sbuffer_.str().c_str());
+ strncpy(s, sbuffer_.str().c_str(), length);
+ s[length] = '\0';
return s;
}
_______________________________________________
Mysqlpp-commits mailing list
[email protected]
https://mail.gna.org/listinfo/mysqlpp-commits