prevent segfault by only copying strlen(ptr) for Bluetooth name - thanks to akolhlsmith for detecting this

This commit is contained in:
matthias.ringwald 2010-07-06 18:13:54 +00:00
parent ad888e05a6
commit 94173b5450

View File

@ -110,7 +110,7 @@ uint16_t hci_create_cmd_internal(uint8_t *hci_cmd_buffer, hci_cmd_t *cmd, va_lis
break;
case 'N': { // UTF-8 string, null terminated
ptr = va_arg(argptr, uint8_t *);
uint16_t len = strlen(ptr);
uint16_t len = strlen((const char*) ptr);
if (len > 248) {
len = 248;
}