Fix build issue for strncpy 40/221140/1
authorAmit Purwar <amit.purwar@samsung.com>
Fri, 27 Dec 2019 10:49:45 +0000 (16:19 +0530)
committerAmit Purwar <amit.purwar@samsung.com>
Fri, 27 Dec 2019 10:51:51 +0000 (16:21 +0530)
Change-Id: Ife86ad79f4a271179a184faf47e489fa88c2f0fa
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
src/adapter.c

index b59b4a8..a38e32d 100644 (file)
@@ -4666,13 +4666,13 @@ static DBusMessage *adapter_le_scan_filter_add_remove(DBusConnection *conn,
                        else
                                addr_type = 0x01;
                } else {
-                       strncpy(string, str, sizeof(string));
+                       strncpy(string, str, sizeof(string) - 1);
                        addr_type = 0x00;
                }
 
                DBG("addr %s, type %d", string, addr_type);
        } else {
-               strncpy(string, str, sizeof(string));
+               strncpy(string, str, sizeof(string) - 1 );
        }
 
 #ifdef TIZEN_FEATURE_PLATFROM_SCAN_FILTER