Opened 2 years ago
Closed 2 years ago
Last modified 2 years ago
Fix for use after free bug in ParseText.cpp (potential memory corruption/crash)
|Reported by:||Gary Buhrmaster <gary.buhrmaster@…>||Owned by:||Gary Buhrmaster <gary.buhrmaster@…>|
|Component:||MythTV - General||Version:||Master Head|
Static analysis (scan-build) detected a use of memory after free (realloc). The new string address should be used rather then the old string address. This patch moves the assignment of the new address to before the use. In addition, to follow the stated conventions, the string is zero terminated (even though this is not really a string). Both changes are consistent with the other code involving this member variable. The code dates from ~2004/6, and this looks like a copy/paste error sometime in the past.