Re: string problems

"Alexander J. Oss" <[email protected]> Sun, 2 Feb 2003 13:29:20 -0500
Newsgroups gmane.comp.gcc.cgicc.general
Message-ID <001c01c2cae9$0339b720$c60d978d@puter>
Vitaliy--

I didn't see anything in FormEntry.cpp called MakeString(), although there's
the method FormEntry::makeString().  You call it "undocumented", which is
reasonable since it's a private method.  I would recommend you take a look
at that method, since the returned string does nothing out of the ordinary;
to build its return value, it creates a string with the default constructor
and then calls std::string::append() several times.

Might you have a buggy std::string implementation?

----- Original Message -----
From: "Vitaliy" <[email protected]>
To: <[email protected]>
Sent: Saturday, February 01, 2003 12:00 PM
Subject: [help-cgicc] string problems


Hello there,

      I have some problems, when trying to work with FormEntry

      When trying 2 post string value > 16 symbols form FORM to .cgi,
      I have dlgheap.c ASSERTION, and then crash!

      All because FormEntry, when receives characters from stdin
      stream, creates sdt::string class's new instance (undocumented
MakeString()), where puts
      that string!

      After this it returns this std::string object (by value)!!!
      In this moment std::string's copy constructor called.

      This copy constructor copyes pointer (not characters)!!!

      when std::string destructor runs... it tryes to free memory, by
      having pointer, BUT! memory, pointed by him is in other
      (cgicc library) heap! dbgheap.c ASSERTS that it cannot free
      memory by this pointer. Pointer MUST come from LOCAL HEAP!!!

      I hope that You will understand that I mean...

Best regards,
 Vitaliy                          mailto:[email protected]




_______________________________________________
help-cgicc mailing list
[email protected]
http://mail.gnu.org/mailman/listinfo/help-cgicc