← Back to team overview

drizzle-discuss team mailing list archive

Bug in rplugin-drizzle-protocol

 

Hi Vijay,

I think I found the problem in your branch.  In loader.cc

    /* Copy the left over options back into argv for further processing.
Once the core is using program options, this whole thing will be done
       differently.
     */
    for (vector<string>::iterator iter= to_pass_further.begin();
         iter != to_pass_further.end();
         ++iter)
    {
      size_t pos= iter-to_pass_further.begin()+1;
      memcpy(argv[pos], (*iter).c_str(), (*iter).size()+1);
      cout << "arg: *" << argv[pos] << "*" << endl;
    }


So as options are consumed they are being put back into argv into different positions. Since argv[pos] could be allocated for a different length than the variable being shoved in at the time you can get in a big mess.

I hope this helps.

Kind Regards
--
Andrew Hutchings - LinuxJedi - http://www.linuxjedi.co.uk/
Certified MySQL Developer, DBA & Cluster DBA
Zend PHP5 Certified Engineer



Follow ups