Developer forums (C::B DEVELOPMENT STRICTLY!) > CodeCompletion redesign

Using uninitialized memory (valgrind report)

<< < (2/3) > >>

oBFusCATed:
Can they be fixed?

ollydbg:

--- Quote from: oBFusCATed on October 16, 2013, 05:18:45 pm ---Can they be fixed?

--- End quote ---
Sure, the main point here is that avoid using a raw pointer. In wx 2.9.x+ under Linux, the UTF8 is used to store characters, so we should use index to access each element of the wxString.

ollydbg:

--- Quote from: ollydbg on October 17, 2013, 01:51:19 am ---the main point here is that avoid using a raw pointer. In wx 2.9.x+ under Linux, the UTF8 is used to store characters, so we should use index to access each element of the wxString.

--- End quote ---
Ok, a little off topic, I see that the new wxString now use fixed width encoding since 2012-05-13, so using a raw pointer(wchar_t *) is OK in all systems. See my post: Re: wxString support in wxWidgets 3.0 problem?

oBFusCATed:
I don't know if it is OK, because I'm not too familiar with wxString in both 2.8 and 2.9, but what I'm sure is that all these constructs in my first post are broken and dangerous.

ollydbg:

--- Quote from: oBFusCATed on October 17, 2013, 06:25:17 pm ---...but what I'm sure is that all these constructs in my first post are broken and dangerous.

--- End quote ---
Yes, the bug in first post should be fixed.
I just debugged a little under wx2.8.12, and see that the wxString is always terminated by Null characters, see the figures and document in the webpage: http://docs.wxwidgets.org/trunk/overview_string.html

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version