net: bcmdhd: Fix string concatenate with strncat() 99/220299/1
authorSeung-Woo Kim <sw0312.kim@samsung.com>
Tue, 17 Dec 2019 03:11:29 +0000 (12:11 +0900)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Tue, 17 Dec 2019 03:11:32 +0000 (12:11 +0900)
There is stringop-overflow warning to use strncat and bound check
for buffer size for the string is already done. Fix string
concatenate with strncat() by replacing with strcat().

Change-Id: I94a75bab9a4e62da4b8796cf3ae223ce8f1f715a
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
drivers/net/wireless/bcmdhd/dhd_linux.c

index e951adf5efb1cba6a6e7e3cfa44e9b3bc1cfad84..11258b6acda88548550547d12175b8f3b9e75701 100644 (file)
@@ -8370,7 +8370,7 @@ dhd_attach(osl_t *osh, struct dhd_bus *bus, uint bus_hdrlen)
                len = strlen(if_name);
                ch = if_name[len - 1];
                if ((ch > '9' || ch < '0') && (len < IFNAMSIZ - 2))
-                       strncat(if_name, "%d", 2);
+                       strcat(if_name, "%d");
        }
 
        /* Passing NULL to dngl_name to ensure host gets if_name in dngl_name member */