Opened 18 years ago
Closed 18 years ago
#5237 closed defect (invalid)
Make sure string allocation is big enough in MHOctetString::MHOctetString()
| Reported by: | Owned by: | Isaac Richards | |
|---|---|---|---|
| Priority: | trivial | Milestone: | unknown |
| Component: | mythtv | Version: | head |
| Severity: | low | Keywords: | |
| Cc: | Ticket locked: | no |
Description
In libmythfreemheg, in the file BaseClasses.cpp the storage for a string is determined by calling strlen(). strlen() gives the size of the string without counting the null terminator. To make sure that there is room for the terminator we need to add one more to the string length.
Attachments (1)
Change History (2)
by , 18 years ago
| Attachment: | libs_libmythfreemheg_BaseClasses.cpp-overrun-dynamic.patch added |
|---|
comment:1 by , 18 years ago
| Resolution: | → invalid |
|---|---|
| Status: | new → closed |
MHOctetString does not include the the null terminator from a char* string. The point of this class is to allow strings with nulls in them, so instead of a null terminator the length of the string is recorded in a separate int.
Note:
See TracTickets
for help on using tickets.

make sure the string buffer is big enough by adding a byte for the null termination