From 49103aff553818ec6cbc4823946d7ee2c73e0ea0 Mon Sep 17 00:00:00 2001 From: Rohit Grover Date: Fri, 28 Nov 2014 12:03:39 +0000 Subject: [PATCH] minor change to a check. --- services/URIBeacon2Service.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/URIBeacon2Service.h b/services/URIBeacon2Service.h index a0d3a2f..7eb6c74 100644 --- a/services/URIBeacon2Service.h +++ b/services/URIBeacon2Service.h @@ -84,10 +84,10 @@ public: resetChar(resetCharUUID, reinterpret_cast(&resetFlag), 1, 1, GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE_WITHOUT_RESPONSE) { - if ((uriDataIn == NULL) || ((uriDataLength = strlen(uriDataIn)) == 0)) { + if ((uriDataIn == NULL) || ((uriDataLength = strlen(uriDataIn)) == 0) || (uriDataLength > MAX_SIZE_URI_DATA_CHAR_VALUE)) { return; } - strncpy(reinterpret_cast(uriData), uriDataIn, MAX_SIZE_URI_DATA_CHAR_VALUE); + strcpy(reinterpret_cast(uriData), uriDataIn); configure(); if (initSucceeded) {