Private
Public Access
2
0

mraa.c: fix possible overrun in strncpy

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Brendan Le Foll
2015-09-18 11:57:41 +01:00
parent 32aa4310c8
commit effc813e42

View File

@@ -411,7 +411,7 @@ mraa_get_platform_name()
if (mraa_has_sub_platform()) {
snprintf(platform_name, MAX_PLATFORM_NAME_LENGTH, "%s + %s", plat->platform_name, plat->sub_platform->platform_name);
} else {
strncpy(platform_name, plat->platform_name, MAX_PLATFORM_NAME_LENGTH);
strncpy(platform_name, plat->platform_name, MAX_PLATFORM_NAME_LENGTH-1);
}
return platform_name;