author | Zhengrong Zhu <zhengrong.zhu@amlogic.com> | 2019-10-31 11:03:02 (GMT) |
---|---|---|
committer | Xiaobo Gu <xiaobo.gu@amlogic.com> | 2019-11-26 05:45:02 (GMT) |
commit | 4aa20f6f4b36d3d3825cbef11e22a6bf7f1744ff (patch) | |
tree | fa890937f0760b5ad1f20ac56c6c16031975128d | |
parent | 001727be92c8e0f9dfe0805754323c538eb0bed5 (diff) | |
download | uboot-4aa20f6f4b36d3d3825cbef11e22a6bf7f1744ff.zip uboot-4aa20f6f4b36d3d3825cbef11e22a6bf7f1744ff.tar.gz uboot-4aa20f6f4b36d3d3825cbef11e22a6bf7f1744ff.tar.bz2 |
hdmitx: bootloader coverity fix - uboot v2015 - hdmi [1/1]
PD#SWPL-14247
Problem:
bootloader coverity fix - uboot v2015 - hdmi
Solution:
Modify code
Verify:
verify on the board of U212
Change-Id: Ie10fed12f11fc8e3b5c402f29bddf35e25fdd276
Signed-off-by: Zhengrong Zhu <zhengrong.zhu@amlogic.com>
-rw-r--r-- | common/hdmi_edid_parsing.c | 1 | ||||
-rw-r--r-- | common/hdmi_parameters.c | 6 |
2 files changed, 5 insertions, 2 deletions
diff --git a/common/hdmi_edid_parsing.c b/common/hdmi_edid_parsing.c index 81837ec..148b643 100644 --- a/common/hdmi_edid_parsing.c +++ b/common/hdmi_edid_parsing.c @@ -117,7 +117,6 @@ static int check_dvi_hdmi_edid_valid(unsigned char *buf) #endif static void dump_dtd_info(struct dtd *t) { - return; /* debug only */ printk("%s[%d]\n", __func__, __LINE__); #define PR(a) pr_info("%s %d\n", #a, t->a) PR(pixel_clock); diff --git a/common/hdmi_parameters.c b/common/hdmi_parameters.c index 91b1ce1..dc682d1 100644 --- a/common/hdmi_parameters.c +++ b/common/hdmi_parameters.c @@ -2126,6 +2126,7 @@ void hdmi_parse_attr(struct hdmi_format_para *para, char const *name) enum hdmi_vic hdmi_get_fmt_vic(char const *name) { int i; + unsigned int name_len; char *lname; enum hdmi_vic vic = HDMI_unkown; struct hdmi_format_para *para = NULL; @@ -2147,7 +2148,10 @@ enum hdmi_vic hdmi_get_fmt_vic(char const *name) if ((vic != HDMI_unkown) && (all_fmt_paras[i] != NULL)) { para = all_fmt_paras[i]; memset(¶->ext_name[0], 0, sizeof(para->ext_name)); - memcpy(¶->ext_name[0], name, strlen(name)); + name_len = strlen(name); + if (name_len > sizeof(para->ext_name) - 1) + name_len = sizeof(para->ext_name) - 1; + memcpy(¶->ext_name[0], name, name_len); hdmi_parse_attr(para, name); } return vic; |