mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
meson: remote: fix coverity warning
PD#172716: meson: remote: fix coverity warning The "strncpy" function does not ensure that the string "ptable->tab.custom_name"ends with a null character. So,the function "strncpy" is replaced by the function "snprintf". This causes "Buffer not null terminated". Change-Id: I4dd7ce89778ba8be7d60f3463e445f5a3a753061 Signed-off-by: Yingyuan Zhu <yingyuan.zhu@amlogic.com>
This commit is contained in:
committed by
Jianxin Pan
parent
ab6c42eeea
commit
99b548faeb
@@ -417,7 +417,7 @@ static int get_custom_tables(struct device_node *node,
|
||||
dev_err(chip->dev, "please config mapname item\n");
|
||||
goto err;
|
||||
}
|
||||
strncpy(ptable->tab.custom_name, uname, CUSTOM_NAME_LEN);
|
||||
snprintf(ptable->tab.custom_name, CUSTOM_NAME_LEN, "%s", uname);
|
||||
|
||||
dev_info(chip->dev, "ptable->custom_name = %s\n",
|
||||
ptable->tab.custom_name);
|
||||
|
||||
Reference in New Issue
Block a user