mirror of
https://github.com/luc-github/ESP3D.git
synced 2026-03-22 15:46:53 +01:00
Add check to avoid buffer overflow on progmem2char
transfer is limited to 300 char string, if over, string is ignored
This commit is contained in:
@@ -332,7 +332,8 @@ const char POLLING_ID[]PROGMEM ="POLLING";
|
||||
char * progmem2char(const char* src)
|
||||
{
|
||||
static char buffer[300];
|
||||
strcpy_P(buffer,src);
|
||||
buffer[0]=0;
|
||||
if(strlen_P(src)<299)strcpy_P(buffer,src);
|
||||
return buffer;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user