Merge pull request #659 from frankonski/buffer_overwrite

Preventing possibility of buffer overwrite.
This commit is contained in:
HomeSpan 2024-01-12 19:30:45 -05:00 committed by GitHub
commit e42cb4e1dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -532,7 +532,7 @@ class SpanCharacteristic{
return(String(c));
case FORMAT::STRING:
case FORMAT::DATA:
sprintf(c,"\"%s\"",u.STRING);
sprintf(c,"\"%.61s\"",u.STRING); // Truncating string to 61 chars.
return(String(c));
} // switch
return(String()); // included to prevent compiler warnings