Merge pull request #4881 from andrethomas/development

PN532: Prevent exception for S,
This commit is contained in:
Theo Arends 2019-01-10 17:14:52 +01:00 committed by GitHub
commit 574ac3b76b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -481,6 +481,10 @@ boolean PN532_Command(void)
} }
if (!strcmp(subStr(sub_string, XdrvMailbox.data, ",", 1),"S")) { if (!strcmp(subStr(sub_string, XdrvMailbox.data, ",", 1),"S")) {
if (paramcount > 1) { if (paramcount > 1) {
if (XdrvMailbox.data[XdrvMailbox.data_len-1] == ',') {
serviced = false;
return serviced;
}
sprintf(sub_string_tmp,subStr(sub_string, XdrvMailbox.data, ",", 2)); sprintf(sub_string_tmp,subStr(sub_string, XdrvMailbox.data, ",", 2));
uint8_t dlen = strlen(sub_string_tmp); uint8_t dlen = strlen(sub_string_tmp);
if (dlen > 15) { dlen = 15; } if (dlen > 15) { dlen = 15; }