forked from TrippyLighting/EthernetBonjour
-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Labels
topic: codeRelated to content of the project itselfRelated to content of the project itselftype: imperfectionPerceived defect in any part of projectPerceived defect in any part of project
Description
In more than one location, space is created with something like:
char* mem = malloc( strlen( text ) );
followed by something like:
strcpy(mem, text);
This only mallocs enough memory for the number of characters in the text, but not for the terminating null, so that the strcpy
writes outside the bounds of the allocated memory.
Better to do something like:
char* mem = malloc( strlen(text) + 1 ); // so that there's room for the terminating null.
Metadata
Metadata
Assignees
Labels
topic: codeRelated to content of the project itselfRelated to content of the project itselftype: imperfectionPerceived defect in any part of projectPerceived defect in any part of project