~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to libdrizzle-2.0/libdrizzle.hpp

  • Committer: Brian Aker
  • Date: 2011-11-18 02:03:41 UTC
  • mto: (2463.1.1 drizzle-include)
  • mto: This revision was merged to the branch mainline in revision 2462.
  • Revision ID: brian@tangent.org-20111118020341-mgz2m1kjo62al44e
Fix safety issues around calling API with no check for NULL

Show diffs side-by-side

added added

removed removed

Lines of Context:
247
247
  query_c& p_name(const std::string& v)
248
248
  {
249
249
    std::vector<char> r(2 * v.size() + 2);
250
 
    r.resize(drizzle_escape_string(&r.front() + 1, v.data(), v.size()) + 2);    
 
250
    r.resize(drizzle_escape_string(&r.front() + 1, r.size(), v.data(), v.size()) + 2);    
251
251
    r.front() = '`';
252
252
    r.back() = '`';
253
253
    p_raw(&r.front(), r.size());
274
274
  query_c& p(const std::string& v)
275
275
  {
276
276
    std::vector<char> r(2 * v.size() + 2);
277
 
    r.resize(drizzle_escape_string(&r.front() + 1, v.data(), v.size()) + 2);    
 
277
    r.resize(drizzle_escape_string(&r.front() + 1, r.size(), v.data(), v.size()) + 2);    
278
278
    r.front() = '\'';
279
279
    r.back() = '\'';
280
280
    p_raw(&r.front(), r.size());